aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorGosha Arinich <me@goshakkk.name>2013-01-07 03:47:49 +0300
committerGosha Arinich <me@goshakkk.name>2013-01-07 04:02:20 +0300
commitd73cc03010d8c936fbcbbf8a77e15c9724872310 (patch)
tree3287298cc9f5f5860077cf0b13a0b982b14a99b4 /actionpack/lib
parentcc24eba5441d80b9e398eeee96c6f1f5647fa85b (diff)
downloadrails-d73cc03010d8c936fbcbbf8a77e15c9724872310.tar.gz
rails-d73cc03010d8c936fbcbbf8a77e15c9724872310.tar.bz2
rails-d73cc03010d8c936fbcbbf8a77e15c9724872310.zip
remove begin-rescue in favor of def-rescue
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/middleware/debug_exceptions.rb19
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