diff options
author | Gosha Arinich <me@goshakkk.name> | 2013-01-07 15:58:55 +0300 |
---|---|---|
committer | Gosha Arinich <me@goshakkk.name> | 2013-01-07 15:58:55 +0300 |
commit | a7f9c596b3c793ef5e0025719f75147334acbab7 (patch) | |
tree | 017009e4a60e6a4b9d9c6f723d3b745a2f4a17f5 /actionpack/lib/action_dispatch/middleware | |
parent | f5da2e82c230210cc7389524d3b6eb404ec0e865 (diff) | |
download | rails-a7f9c596b3c793ef5e0025719f75147334acbab7.tar.gz rails-a7f9c596b3c793ef5e0025719f75147334acbab7.tar.bz2 rails-a7f9c596b3c793ef5e0025719f75147334acbab7.zip |
refactor ShowExceptions' #call to use def-rescue instead of begin-rescue
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/show_exceptions.rb | 11 |
1 files changed, 4 insertions, 7 deletions
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 |