Class: Bugsnag::Delivery::Synchronous
- Inherits:
-
Object
- Object
- Bugsnag::Delivery::Synchronous
- Defined in:
- lib/bugsnag/delivery/synchronous.rb
Direct Known Subclasses
Class Method Summary collapse
-
.deliver(url, body, configuration, options = {}) ⇒ Object
Attempts to deliver a payload to the given endpoint synchronously.
Class Method Details
.deliver(url, body, configuration, options = {}) ⇒ Object
Attempts to deliver a payload to the given endpoint synchronously.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bugsnag/delivery/synchronous.rb', line 9 def deliver(url, body, configuration, ={}) begin response = request(url, body, configuration, ) configuration.debug("Request to #{url} completed, status: #{response.code}") if response.code[0] != "2" configuration.warn("Notifications to #{url} was reported unsuccessful with code #{response.code}") end rescue StandardError => e # KLUDGE: Since we don't re-raise http exceptions, this breaks rspec raise if e.class.to_s == "RSpec::Expectations::ExpectationNotMetError" configuration.error("Unable to send information to Bugsnag (#{url}), #{e.inspect}") configuration.error(e.backtrace) end end |