Class: Ezlog::Rails::LogExceptions

Inherits:
Object
  • Object
show all
Defined in:
lib/ezlog/rails/log_exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, logger) ⇒ LogExceptions

Returns a new instance of LogExceptions.



4
5
6
7
# File 'lib/ezlog/rails/log_exceptions.rb', line 4

def initialize(app, logger)
  @app = app
  @logger = logger
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/ezlog/rails/log_exceptions.rb', line 9

def call(env)
  @app.call(env)
rescue Exception => exception
  @logger.error exception unless handled?(exception)
  raise
end