Class: JetstreamBridge::ConsumerMiddleware::ErrorHandlingMiddleware
- Inherits:
-
Object
- Object
- JetstreamBridge::ConsumerMiddleware::ErrorHandlingMiddleware
- Defined in:
- lib/jetstream_bridge/consumer/middleware.rb
Overview
Error handling middleware with configurable retry logic
Instance Method Summary collapse
- #call(event) ⇒ Object
-
#initialize(on_error: nil) ⇒ ErrorHandlingMiddleware
constructor
A new instance of ErrorHandlingMiddleware.
Constructor Details
#initialize(on_error: nil) ⇒ ErrorHandlingMiddleware
74 75 76 |
# File 'lib/jetstream_bridge/consumer/middleware.rb', line 74 def initialize(on_error: nil) @on_error = on_error end |
Instance Method Details
#call(event) ⇒ Object
78 79 80 81 82 83 |
# File 'lib/jetstream_bridge/consumer/middleware.rb', line 78 def call(event) yield rescue StandardError => e @on_error&.call(event, e) raise end |