From a7f9c596b3c793ef5e0025719f75147334acbab7 Mon Sep 17 00:00:00 2001 From: Gosha Arinich Date: Mon, 7 Jan 2013 15:58:55 +0300 Subject: refactor ShowExceptions' #call to use def-rescue instead of begin-rescue --- actionpack/lib/action_dispatch/middleware/show_exceptions.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb index 07ecf9702e..fcc5bc12c4 100644 --- a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb @@ -27,13 +27,10 @@ module ActionDispatch end def call(env) - begin - response = @app.call(env) - rescue Exception => exception - raise exception if env['action_dispatch.show_exceptions'] == false - end - - response || render_exception(env, exception) + @app.call(env) + rescue Exception => exception + raise exception if env['action_dispatch.show_exceptions'] == false + render_exception(env, exception) end private -- cgit v1.2.3