Permalink
Browse files

Remove surprise if from show_exception middleware

This increase the readability within the rescue block.
  • Loading branch information...
sikachu committed Oct 26, 2013
1 parent db61355 commit 0f0630aaaeef2a7f9b57e09906a420b99a4f862f
Showing with 5 additions and 2 deletions.
  1. +5 −2 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -29,8 +29,11 @@ def initialize(app, exceptions_app)
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

0 comments on commit 0f0630a

Please sign in to comment.