Class: Trackets::Middleware::RackExceptionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/trackets/middleware/rack_exception_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RackExceptionHandler

Returns a new instance of RackExceptionHandler.



5
6
7
# File 'lib/trackets/middleware/rack_exception_handler.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/trackets/middleware/rack_exception_handler.rb', line 9

def call(env)
  response = @app.call(env)
rescue RuntimeError => exception
  Trackets.notify(exception, env)
  raise exception
end