mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add ensure block to make sure the state is properly restored
This commit is contained in:
parent
1fef1bedbc
commit
7fb536972e
2 changed files with 2 additions and 2 deletions
|
@ -28,7 +28,7 @@ module ActionDispatch
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
begin
|
begin
|
||||||
response = @app.call(env)
|
response = @app.call(env)
|
||||||
rescue Exception => exception
|
rescue Exception => exception
|
||||||
raise exception if env['action_dispatch.show_exceptions'] == false
|
raise exception if env['action_dispatch.show_exceptions'] == false
|
||||||
end
|
end
|
||||||
|
|
|
@ -104,7 +104,7 @@ module ShowExceptions
|
||||||
get '/', {}, 'HTTP_ACCEPT' => 'text/json'
|
get '/', {}, 'HTTP_ACCEPT' => 'text/json'
|
||||||
assert_response :internal_server_error
|
assert_response :internal_server_error
|
||||||
assert_equal 'text/plain', response.content_type.to_s
|
assert_equal 'text/plain', response.content_type.to_s
|
||||||
|
ensure
|
||||||
@app.instance_variable_set(:@exceptions_app, @exceptions_app)
|
@app.instance_variable_set(:@exceptions_app, @exceptions_app)
|
||||||
$stderr = STDERR
|
$stderr = STDERR
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue