Class: Timber::Integrations::Rack::ExceptionEvent
- Inherits:
-
Object
- Object
- Timber::Integrations::Rack::ExceptionEvent
- Defined in:
- lib/timber/integrations/rack/exception_event.rb
Overview
Reponsible for capturing exceptions events within a Rack stack.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ExceptionEvent
constructor
A new instance of ExceptionEvent.
Constructor Details
#initialize(app) ⇒ ExceptionEvent
Returns a new instance of ExceptionEvent.
6 7 8 |
# File 'lib/timber/integrations/rack/exception_event.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/timber/integrations/rack/exception_event.rb', line 10 def call(env) begin status, headers, body = @app.call(env) rescue Exception => exception Config.instance.logger.fatal do Events::Exception.new( name: exception.class.name, exception_message: exception., backtrace: exception.backtrace ) end raise exception end end |