aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikac.hu>2013-10-27 00:55:22 +0700
committerPrem Sichanugrist <s@sikac.hu>2013-10-27 00:55:22 +0700
commit0f0630aaaeef2a7f9b57e09906a420b99a4f862f (patch)
tree781902774a85dfcb8fcaab3824f7e999e1b6d3cc /actionpack
parentdb61355f7171819c078847337aa65f8d74aec4b8 (diff)
downloadrails-0f0630aaaeef2a7f9b57e09906a420b99a4f862f.tar.gz
rails-0f0630aaaeef2a7f9b57e09906a420b99a4f862f.tar.bz2
rails-0f0630aaaeef2a7f9b57e09906a420b99a4f862f.zip
Remove surprise if from show_exception middleware
This increase the readability within the rescue block.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/show_exceptions.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
index fcc5bc12c4..1d4f0f89a6 100644
--- a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
+++ b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -29,8 +29,11 @@ module ActionDispatch
def call(env)
@app.call(env)
rescue Exception => exception
- raise exception if env['action_dispatch.show_exceptions'] == false
- render_exception(env, exception)
+ if env['action_dispatch.show_exceptions'] == false
+ raise exception
+ else
+ render_exception(env, exception)
+ end
end
private