Class: Mihari::Web::Middleware::CaptureExceptions

Inherits:
Sentry::Rack::CaptureExceptions
  • Object
show all
Includes:
Concerns::ErrorUnwrappable
Defined in:
lib/mihari/web/middleware/capture_exceptions.rb

Overview

Customized Sentry::Rack::CaptureExceptions

Instance Method Summary collapse

Methods included from Concerns::ErrorUnwrappable

#unwrap_error

Instance Method Details

#capture_exception(exception, env) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/mihari/web/middleware/capture_exceptions.rb', line 12

def capture_exception(exception, env)
  unwrapped = unwrap_error(exception)
  Mihari.logger.error unwrapped

  Sentry.capture_exception(unwrapped).tap do |event|
    env[ERROR_EVENT_ID_KEY] = event.event_id if event
  end
end