Class: Sentry::Rails::RescuedExceptionInterceptor
- Inherits:
-
Object
- Object
- Sentry::Rails::RescuedExceptionInterceptor
- Defined in:
- lib/sentry/rails/rescued_exception_interceptor.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RescuedExceptionInterceptor
constructor
A new instance of RescuedExceptionInterceptor.
- #report_rescued_exceptions? ⇒ Boolean
Constructor Details
#initialize(app) ⇒ RescuedExceptionInterceptor
Returns a new instance of RescuedExceptionInterceptor.
6 7 8 |
# File 'lib/sentry/rails/rescued_exception_interceptor.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 |
# File 'lib/sentry/rails/rescued_exception_interceptor.rb', line 10 def call(env) return @app.call(env) unless Sentry.initialized? begin @app.call(env) rescue => e env["sentry.rescued_exception"] = e if report_rescued_exceptions? raise e end end |
#report_rescued_exceptions? ⇒ Boolean
21 22 23 |
# File 'lib/sentry/rails/rescued_exception_interceptor.rb', line 21 def report_rescued_exceptions? Sentry.configuration.rails.report_rescued_exceptions end |