Class: Rack::Exceptions
- Inherits:
-
Object
- Object
- Rack::Exceptions
- Defined in:
- lib/rack/exceptions.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, backend = nil) ⇒ Exceptions
constructor
A new instance of Exceptions.
Constructor Details
#initialize(app, backend = nil) ⇒ Exceptions
Returns a new instance of Exceptions.
3 4 5 6 |
# File 'lib/rack/exceptions.rb', line 3 def initialize(app, backend = nil) @app = app @backend = backend end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rack/exceptions.rb', line 8 def call(env) begin response = @app.call(env) rescue Exception => e backend.rack_exception(e, env) raise end response ensure backend.clear_context end |