Class: Rack::Banken::ExceptionHandler
- Inherits:
-
Object
- Object
- Rack::Banken::ExceptionHandler
- Defined in:
- lib/rack/banken/exception_handler.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ExceptionHandler
constructor
A new instance of ExceptionHandler.
Constructor Details
#initialize(app) ⇒ ExceptionHandler
Returns a new instance of ExceptionHandler.
5 6 7 |
# File 'lib/rack/banken/exception_handler.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 |
# File 'lib/rack/banken/exception_handler.rb', line 9 def call(env) begin @app.call(env) rescue Exceptions::Base => e raise e.class, e. rescue => e raise Exceptions::InternalServerError, e. end rescue Exceptions::Base => exception exception.to_rack_response end |