Class: Stackify::ErrorsCatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/stackify/rack/errors_catcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, &block) ⇒ ErrorsCatcher

Returns a new instance of ErrorsCatcher.



3
4
5
6
# File 'lib/stackify/rack/errors_catcher.rb', line 3

def initialize(app, &block)
  @app = app
  @block = block
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/stackify/rack/errors_catcher.rb', line 8

def call(env)
  @block.call env
  @app.call env
rescue Exception => exception
  Stackify.logger_client.log_exception(StackifiedError.new exception, binding)
  raise exception
end