Class: TgErrorNotifier::Middleware
- Inherits:
-
Object
- Object
- TgErrorNotifier::Middleware
- Defined in:
- lib/tg_error_notifier/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
5 6 7 |
# File 'lib/tg_error_notifier/middleware.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/tg_error_notifier/middleware.rb', line 9 def call(env) @app.call(env) rescue StandardError => e TgErrorNotifier.notify( exception: e, source: "rack", context: { method: env["REQUEST_METHOD"], path: env["PATH_INFO"], query: env["QUERY_STRING"], request_id: env["action_dispatch.request_id"] } ) raise end |