提交 16ae08ff 编写于 作者: A Aaron Patterson

use raise to create exceptions and to set the backtrace

上级 1d9c5552
......@@ -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
......
......@@ -450,7 +450,7 @@ def generate
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?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册