Class: PostHog::Rails::RescuedExceptionInterceptor Private
- Inherits:
-
Object
- Object
- PostHog::Rails::RescuedExceptionInterceptor
- Defined in:
- lib/posthog/rails/rescued_exception_interceptor.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Middleware that intercepts exceptions that are rescued by Rails. This middleware runs before ShowExceptions and captures the exception so we can report it even if Rails rescues it.
Instance Method Summary collapse
-
#call(env) ⇒ Array
private
Rack response.
-
#initialize(app) ⇒ RescuedExceptionInterceptor
constructor
private
A new instance of RescuedExceptionInterceptor.
Constructor Details
#initialize(app) ⇒ RescuedExceptionInterceptor
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RescuedExceptionInterceptor.
12 13 14 |
# File 'lib/posthog/rails/rescued_exception_interceptor.rb', line 12 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Rack response.
18 19 20 21 22 23 24 |
# File 'lib/posthog/rails/rescued_exception_interceptor.rb', line 18 def call(env) @app.call(env) rescue StandardError => e # Store the exception so CaptureExceptions middleware can report it env['posthog.rescued_exception'] = e if should_intercept? raise e end |