1
0
Fork 0
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:
Carlos Antonio da Silva 2012-11-04 19:50:56 -02:00
parent 1fef1bedbc
commit 7fb536972e
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ module ActionDispatch
def call(env)
begin
response = @app.call(env)
response = @app.call(env)
rescue Exception => exception
raise exception if env['action_dispatch.show_exceptions'] == false
end

View file

@ -104,7 +104,7 @@ module ShowExceptions
get '/', {}, 'HTTP_ACCEPT' => 'text/json'
assert_response :internal_server_error
assert_equal 'text/plain', response.content_type.to_s
ensure
@app.instance_variable_set(:@exceptions_app, @exceptions_app)
$stderr = STDERR
end