Class: Raven::Transports::HTTP
- Defined in:
- lib/raven/transports/http.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#conn ⇒ Object
Returns the value of attribute conn.
Attributes inherited from Transport
Instance Method Summary collapse
-
#initialize(*args) ⇒ HTTP
constructor
A new instance of HTTP.
- #send_event(auth_header, data, options = {}) ⇒ Object
Constructor Details
#initialize(*args) ⇒ HTTP
Returns a new instance of HTTP.
11 12 13 14 15 |
# File 'lib/raven/transports/http.rb', line 11 def initialize(*args) super self.adapter = configuration.http_adapter || Faraday.default_adapter self.conn = set_conn end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
9 10 11 |
# File 'lib/raven/transports/http.rb', line 9 def adapter @adapter end |
#conn ⇒ Object
Returns the value of attribute conn.
9 10 11 |
# File 'lib/raven/transports/http.rb', line 9 def conn @conn end |
Instance Method Details
#send_event(auth_header, data, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/raven/transports/http.rb', line 17 def send_event(auth_header, data, = {}) unless configuration.sending_allowed? logger.debug("Event not sent: #{configuration.}") end project_id = configuration[:project_id] path = configuration[:path] + "/" conn.post "#{path}api/#{project_id}/store/" do |req| req.headers['Content-Type'] = [:content_type] req.headers['X-Sentry-Auth'] = auth_header req.body = data end rescue Faraday::ClientError => ex error_info = ex. error_info += " Error in headers is: #{ex.response[:headers]['x-sentry-error']}" if ex.response[:headers]['x-sentry-error'] raise Raven::Error, error_info end |