mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Always raise errors when show_exceptions enabled
This commit is contained in:
parent
5531fa3820
commit
2cbc4912ee
2 changed files with 4 additions and 8 deletions
|
@ -533,7 +533,7 @@ module Sinatra
|
|||
@env['sinatra.error'] = boom
|
||||
|
||||
dump_errors!(boom) if options.dump_errors?
|
||||
raise boom if options.raise_errors?
|
||||
raise boom if options.raise_errors? || options.show_exceptions?
|
||||
|
||||
@response.status = 500
|
||||
error_block! boom.class, Exception
|
||||
|
@ -837,12 +837,9 @@ module Sinatra
|
|||
def new(*args, &bk)
|
||||
builder = Rack::Builder.new
|
||||
builder.use Rack::Session::Cookie if sessions? && !test?
|
||||
builder.use Rack::CommonLogger if logging?
|
||||
builder.use Rack::MethodOverride if methodoverride?
|
||||
if show_exceptions?
|
||||
enable :raise_errors
|
||||
builder.use ShowExceptions
|
||||
end
|
||||
builder.use Rack::CommonLogger if logging?
|
||||
builder.use Rack::MethodOverride if methodoverride?
|
||||
builder.use ShowExceptions if show_exceptions?
|
||||
|
||||
@middleware.each { |c,a,b| builder.use(c, *a, &b) }
|
||||
builder.run super
|
||||
|
|
|
@ -202,7 +202,6 @@ describe_option 'show_exceptions' do
|
|||
}
|
||||
|
||||
get '/'
|
||||
assert @app.raise_errors? # it enables raise_errors when enabled
|
||||
assert_equal 500, status
|
||||
assert body.include?("StandardError")
|
||||
assert body.include?("<code>show_exceptions</code> option")
|
||||
|
|
Loading…
Reference in a new issue