Class: Namira::Middleware::Timeout
- Inherits:
-
Object
- Object
- Namira::Middleware::Timeout
- Defined in:
- lib/namira/middleware/timeout.rb
Overview
Handles timeout errors
Instance Method Summary collapse
-
#call(env) ⇒ Object
Called by the middleware runner.
-
#initialize(app) ⇒ Timeout
constructor
A new instance of Timeout.
Constructor Details
#initialize(app) ⇒ Timeout
Returns a new instance of Timeout.
6 7 8 |
# File 'lib/namira/middleware/timeout.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
Called by the middleware runner.
14 15 16 17 18 |
# File 'lib/namira/middleware/timeout.rb', line 14 def call(env) @app.call(env) rescue HTTP::TimeoutError => e raise Errors::TimeoutError.new(e.) end |