class Sinatra::ShowExceptions

information helpful to attackers.
Be careful when you use this on public-facing sites as it could reveal
context, the whole Rack environment and the request data.
wraps. It shows a useful backtrace with the sourcefile and clickable
Sinatra::ShowExceptions catches all exceptions raised from the app it

def frame_class(frame)

def frame_class(frame)
  if frame.filename =~ /lib\/sinatra.*\.rb/
    "framework"
  elsif (defined?(Gem) && frame.filename.include?(Gem.dir)) ||
        frame.filename =~ /\/bin\/(\w+)$/
    "system"
  else
    "app"
  end
end

def initialize(app)

def initialize(app)
  @app      = app
  @template = ERB.new(TEMPLATE)
end