diff options
author | Gosha Arinich <me@goshakkk.name> | 2013-01-07 03:47:49 +0300 |
---|---|---|
committer | Gosha Arinich <me@goshakkk.name> | 2013-01-07 04:02:20 +0300 |
commit | d73cc03010d8c936fbcbbf8a77e15c9724872310 (patch) | |
tree | 3287298cc9f5f5860077cf0b13a0b982b14a99b4 | |
parent | cc24eba5441d80b9e398eeee96c6f1f5647fa85b (diff) | |
download | rails-d73cc03010d8c936fbcbbf8a77e15c9724872310.tar.gz rails-d73cc03010d8c936fbcbbf8a77e15c9724872310.tar.bz2 rails-d73cc03010d8c936fbcbbf8a77e15c9724872310.zip |
remove begin-rescue in favor of def-rescue
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb index f897d9b0bc..64230ff1ae 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb @@ -14,18 +14,17 @@ module ActionDispatch end def call(env) - begin - _, headers, body = response = @app.call(env) - - if headers['X-Cascade'] == 'pass' - body.close if body.respond_to?(:close) - raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}" - end - rescue Exception => exception - raise exception if env['action_dispatch.show_exceptions'] == false + _, headers, body = response = @app.call(env) + + if headers['X-Cascade'] == 'pass' + body.close if body.respond_to?(:close) + raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}" end - exception ? render_exception(env, exception) : response + response + rescue Exception => exception + raise exception if env['action_dispatch.show_exceptions'] == false + render_exception(env, exception) end private |