class Raven::Transports::HTTP
Attributes
adapter[RW]
conn[RW]
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
Raven::Transports::Transport::new
# File sentry-raven/lib/raven/transports/http.rb, line 8 def initialize(*args) super self.adapter = configuration.http_adapter || Faraday.default_adapter self.conn = set_conn end
Public Instance Methods
send_event(auth_header, data, options = {})
click to toggle source
# File sentry-raven/lib/raven/transports/http.rb, line 14 def send_event(auth_header, data, options = {}) unless configuration.sending_allowed? configuration.logger.debug("Event not sent: #{configuration.error_messages}") return end project_id = configuration[:project_id] path = configuration[:path] + "/" conn.post "#{path}api/#{project_id}/store/" do |req| req.headers['Content-Type'] = options[:content_type] req.headers['X-Sentry-Auth'] = auth_header req.body = data end rescue Faraday::Error => e error_info = e.message if e.response && e.response[:headers]['x-sentry-error'] error_info += " Error in headers is: #{e.response[:headers]['x-sentry-error']}" end raise Raven::Error, error_info end