Class: PlainApm::Extensions::Exceptions::Rack

Inherits:
Object
  • Object
show all
Includes:
PlainApm::EventAttributes
Defined in:
lib/plain_apm/extensions/exceptions/rack.rb

Constant Summary

Constants included from PlainApm::EventAttributes

PlainApm::EventAttributes::IGNORED_EXCEPTIONS, PlainApm::EventAttributes::SOURCES_WITH_EXTRA_ATTRIBUTES

Instance Method Summary collapse

Methods included from PlainApm::EventAttributes

#attributes_from_exception, #attributes_from_notification

Constructor Details

#initialize(app) ⇒ Rack

Returns a new instance of Rack.



9
10
11
# File 'lib/plain_apm/extensions/exceptions/rack.rb', line 9

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/plain_apm/extensions/exceptions/rack.rb', line 13

def call(env)
  response = @app.call(env)

  e = env["action_dispatch.exception"]
  report_exception(e, env) unless e.nil?

  response
rescue Exception => e # standard:disable Lint/RescueException
  report_exception(e, env)
  raise
end