Class: ExceptionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ExceptionHandler

Returns a new instance of ExceptionHandler.



2
3
4
5
# File 'lib/exception_handler.rb', line 2

def initialize(app)
  @app = app
  @res = Rack::Response.new
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/exception_handler.rb', line 7

def call(env)
  begin
    app.call(env)
  rescue => e
    puts e
  end
end