Class: ShowExceptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ShowExceptions

Returns a new instance of ShowExceptions.


5
6
7
# File 'lib/show_exceptions.rb', line 5

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.


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

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object


9
10
11
12
13
14
15
# File 'lib/show_exceptions.rb', line 9

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