class Timber::Integrations::Rack::ErrorEvent

A Rack middleware that is reponsible for capturing exception and error events

Public Instance Methods

call(env) click to toggle source
# File lib/timber-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.message,
        backtrace: exception.backtrace
      )
    end

    raise exception
  end
end