Method: Raven::Client#send_event

Defined in:
lib/raven/client.rb

#send_event(event) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/raven/client.rb', line 21

def send_event(event)
  return false unless configuration.sending_allowed?(event)

  # Convert to hash
  event = event.to_hash

  unless @state.should_try?
    failed_send(nil, event)
    return
  end

  configuration.logger.info "Sending event #{event[:event_id]} to Sentry"

  content_type, encoded_data = encode(event)

  begin
    transport.send_event(generate_auth_header, encoded_data,
                         :content_type => content_type)
    successful_send
  rescue => e
    failed_send(e, event)
    return
  end

  event
end