From 0f0630aaaeef2a7f9b57e09906a420b99a4f862f Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sun, 27 Oct 2013 00:55:22 +0700 Subject: Remove surprise if from show_exception middleware This increase the readability within the rescue block. --- actionpack/lib/action_dispatch/middleware/show_exceptions.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware') 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 -- cgit v1.2.3