mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
remove begin-rescue in favor of def-rescue
This commit is contained in:
parent
cc24eba544
commit
d73cc03010
1 changed files with 8 additions and 9 deletions
|
@ -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
|
||||
|
||||
response
|
||||
rescue Exception => exception
|
||||
raise exception if env['action_dispatch.show_exceptions'] == false
|
||||
end
|
||||
|
||||
exception ? render_exception(env, exception) : response
|
||||
render_exception(env, exception)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Reference in a new issue