Class: Ditty::Middleware::ErrorCatchall
- Inherits:
-
Object
- Object
- Ditty::Middleware::ErrorCatchall
- Defined in:
- lib/ditty/middleware/error_catchall.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ErrorCatchall
constructor
A new instance of ErrorCatchall.
Constructor Details
#initialize(app) ⇒ ErrorCatchall
Returns a new instance of ErrorCatchall.
6 7 8 |
# File 'lib/ditty/middleware/error_catchall.rb', line 6 def initialize(app) @app = app end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/ditty/middleware/error_catchall.rb', line 4 def env @env end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/ditty/middleware/error_catchall.rb', line 10 def call(env) @env = env begin @app.call env rescue StandardError [500, {}, ['Unknown Error']] end end |