Class: Bugsnag::Shoryuken

Inherits:
Object
  • Object
show all
Defined in:
lib/bugsnag/integrations/shoryuken.rb

Constant Summary collapse

FRAMEWORK_ATTRIBUTES =
{
  :framework => "Shoryuken"
}

Instance Method Summary collapse

Constructor Details

#initializeShoryuken

Returns a new instance of Shoryuken.



10
11
12
13
14
15
# File 'lib/bugsnag/integrations/shoryuken.rb', line 10

def initialize
  Bugsnag.configure do |config|
    config.app_type ||= "shoryuken"
    config.default_delivery_method = :synchronous
  end
end

Instance Method Details

#call(_, queue, _, body) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bugsnag/integrations/shoryuken.rb', line 17

def call(_, queue, _, body)
  begin
    Bugsnag.before_notify_callbacks << lambda {|report|
      report.add_tab(:shoryuken, {
        queue: queue,
        body: body
      })
    }

    yield
  rescue Exception => ex
    unless [Interrupt, SystemExit, SignalException].include?(ex.class)
      Bugsnag.auto_notify(ex, true) do |report|
        report.severity = "error"
        report.severity_reason = {
          :type => Bugsnag::Report::UNHANDLED_EXCEPTION_MIDDLEWARE,
          :attributes => Bugsnag::Shoryuken::FRAMEWORK_ATTRIBUTES
        }
      end
    end
    raise
  ensure
    Bugsnag.configuration.clear_request_data
  end
end