Class: Bugsnag::Middleware::Callbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/bugsnag/middleware/callbacks.rb

Overview

Calls all configured callbacks passing an error report

Instance Method Summary collapse

Constructor Details

#initialize(bugsnag) ⇒ Callbacks

Returns a new instance of Callbacks.



5
6
7
# File 'lib/bugsnag/middleware/callbacks.rb', line 5

def initialize(bugsnag)
  @bugsnag = bugsnag
end

Instance Method Details

#call(report) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/bugsnag/middleware/callbacks.rb', line 9

def call(report)
  if report.request_data[:before_callbacks]
    report.request_data[:before_callbacks].each {|c| c.call(*[report][0...c.arity]) }
  end

  @bugsnag.call(report)
end