Class: Bugsnag::Delivery::Synchronous

Inherits:
Object
  • Object
show all
Defined in:
lib/bugsnag/delivery/synchronous.rb

Direct Known Subclasses

ThreadQueue

Constant Summary collapse

HEADERS =
{"Content-Type" => "application/json"}

Class Method Summary collapse

Class Method Details

.deliver(url, body, configuration) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/bugsnag/delivery/synchronous.rb', line 10

def deliver(url, body, configuration)
  begin
    response = request(url, body, configuration)
    Bugsnag.debug("Notification to #{url} finished, response was #{response.code}, payload was #{body}")
  rescue StandardError => e
    # KLUDGE: Since we don't re-raise http exceptions, this breaks rspec
    raise if e.class.to_s == "RSpec::Expectations::ExpectationNotMetError"

    Bugsnag.warn("Notification to #{url} failed, #{e.inspect}")
    Bugsnag.warn(e.backtrace)
  end
end