Class: BammLog::ExceptionMiddleware
- Inherits:
-
Object
- Object
- BammLog::ExceptionMiddleware
- Defined in:
- lib/bamm_log/exception_middleware.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ ExceptionMiddleware
constructor
A new instance of ExceptionMiddleware.
Constructor Details
#initialize(app, options = {}) ⇒ ExceptionMiddleware
Returns a new instance of ExceptionMiddleware.
6 7 8 |
# File 'lib/bamm_log/exception_middleware.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/bamm_log/exception_middleware.rb', line 4 def env @env end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bamm_log/exception_middleware.rb', line 10 def call(env) @env = env begin log_start log_params @app.call(env) rescue Exception => e log_exception @app.call(env) end end |