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 lib/raven/transports/http.rb, line 11
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 lib/raven/transports/http.rb, line 17
def send_event(auth_header, data, options = {})
  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::ClientError => ex
  raise Raven::Error, ex.message
end