Permalink
Browse files

use raise to create exceptions and to set the backtrace

  • Loading branch information...
1 parent 20062e7 commit 88747336e89a71aa0c22c357539d997debd5348b @tenderlove tenderlove committed Jan 12, 2011
View
2 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -50,7 +50,7 @@ def call(env)
# Only this middleware cares about RoutingError. So, let's just raise
# it here.
if headers['X-Cascade'] == 'pass'
- exception = ActionController::RoutingError.new("No route matches #{env['PATH_INFO'].inspect}")
+ raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect}"
end
rescue Exception => exception
raise exception if env['action_dispatch.show_exceptions'] == false
View
2 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -421,7 +421,7 @@ def opts
end
def raise_routing_error
- raise ActionController::RoutingError.new("No route matches #{options.inspect}")
+ raise ActionController::RoutingError, "No route matches #{options.inspect}"
end
def different_controller?

0 comments on commit 8874733

Please sign in to comment.