class Bezel::ShowExceptions

Attributes

app[R]

Public Class Methods

new(app) click to toggle source
# File lib/show_exceptions.rb, line 6
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/show_exceptions.rb, line 10
def call(env)
  begin
    app.call(env)
  rescue Exception => e
    render_exception(e)
  end
end

Private Instance Methods

render_exception(e) click to toggle source
# File lib/show_exceptions.rb, line 20
def render_exception(e)
  response = Rack::Response.new([], 500, 'Content_Type'=> 'text/html')
  response.write(e.message)
  response.finish
end