diff options
author | Prem Sichanugrist <s@sikac.hu> | 2013-10-27 00:55:22 +0700 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2013-10-27 00:55:22 +0700 |
commit | 0f0630aaaeef2a7f9b57e09906a420b99a4f862f (patch) | |
tree | 781902774a85dfcb8fcaab3824f7e999e1b6d3cc /actionpack/lib | |
parent | db61355f7171819c078847337aa65f8d74aec4b8 (diff) | |
download | rails-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/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/show_exceptions.rb | 7 |
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 |