Class: ExceptionEngine::ExceptionMiddleware
- Inherits:
-
Object
- Object
- ExceptionEngine::ExceptionMiddleware
- Defined in:
- lib/exception_engine/exception_middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ExceptionMiddleware
constructor
A new instance of ExceptionMiddleware.
Constructor Details
#initialize(app) ⇒ ExceptionMiddleware
Returns a new instance of ExceptionMiddleware.
3 4 5 |
# File 'lib/exception_engine/exception_middleware.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/exception_engine/exception_middleware.rb', line 7 def call(env) begin response = @app.call(env) rescue Exception => raised ExceptionEngine.exceptionize(raised) raise end if env['rack.exception'] ExceptionEngine.exceptionize(raised) end response end |