Created
June 9, 2015 05:56
-
-
Save kgrz/76401485d47d94db33c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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