Class: LoggingElf::UncaughtExceptionsMiddleware
- Inherits:
-
Object
- Object
- LoggingElf::UncaughtExceptionsMiddleware
- Defined in:
- lib/logging_elf/uncaught_exceptions_middleware.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, args = {}) ⇒ UncaughtExceptionsMiddleware
constructor
A new instance of UncaughtExceptionsMiddleware.
Constructor Details
#initialize(app, args = {}) ⇒ UncaughtExceptionsMiddleware
Returns a new instance of UncaughtExceptionsMiddleware.
4 5 6 7 |
# File 'lib/logging_elf/uncaught_exceptions_middleware.rb', line 4 def initialize(app, args = {}) self.logger = args[:logger] @app = app end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/logging_elf/uncaught_exceptions_middleware.rb', line 3 def logger @logger end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/logging_elf/uncaught_exceptions_middleware.rb', line 9 def call(env) begin response = @app.call env rescue => err logger.error err raise err end log_rack_exceptions(env) response end |