diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index de6b55421911664f6dc5cc4dc3aba6e8de317847..fd39b1991b4b3deddfe43405cdb94087a4771957 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -40,7 +40,7 @@ def dispatch(cgi = nil, session_options = ActionController::CgiRequest::DEFAULT_ end rescue Exception => exception # errors from CGI dispatch failsafe_response(cgi, output, '500 Internal Server Error', exception) do - controller ||= ApplicationController rescue ActionController::Base + controller ||= (ApplicationController rescue ActionController::Base) controller.process_with_exception(request, response, exception).out(output) end ensure