Browse files

Add ensure block to make sure the state is properly restored

  • Loading branch information...
1 parent 1fef1be commit 7fb536972e6b861c7a7714ef22d5e9b9527d8be0 @carlosantoniodasilva carlosantoniodasilva committed Nov 4, 2012
View
2 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -28,7 +28,7 @@ def initialize(app, exceptions_app)
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
2 actionpack/test/controller/show_exceptions_test.rb
@@ -104,7 +104,7 @@ def test_render_failsafe_exception
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

0 comments on commit 7fb5369

Please sign in to comment.