Class: Logtail::Integrations::Rack::ErrorEvent
- Inherits:
-
Middleware
- Object
- Middleware
- Logtail::Integrations::Rack::ErrorEvent
- Defined in:
- lib/logtail-rack/error_event.rb
Overview
A Rack middleware that is reponsible for capturing exception and error events
Instance Method Summary collapse
Methods inherited from Middleware
enabled=, enabled?, #initialize
Constructor Details
This class inherits a constructor from Logtail::Integrations::Rack::Middleware
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/logtail-rack/error_event.rb', line 10 def call(env) begin status, headers, body = @app.call(env) rescue Exception => exception Config.instance.logger.fatal do Events::Error.new( name: exception.class.name, error_message: exception., backtrace: exception.backtrace ) end raise exception end end |