Skip to content

Instantly share code, notes, and snippets.

@kgrz
Created June 9, 2015 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgrz/76401485d47d94db33c7 to your computer and use it in GitHub Desktop.
Save kgrz/76401485d47d94db33c7 to your computer and use it in GitHub Desktop.
# foo.ru
require 'sinatra/base'
class ErrorTest
def initialize(app)
end
def call(env)
raise "test!"
end
end
class Server < Sinatra::Base
enable :dump_errors
# If this is commented out, and the page http://localhost:9292 is loaded,
# then the standard exception page is shown and the backtrace is logged to
# the terminal.
#
# However, if the error is raised in the middleware (that is, this line is
# uncommented), then the error page is shown but the stack trace is not
# shown.
#use ErrorTest
get '/' do
raise "test2"
end
end
run Server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment