Skip to content

Commit

Permalink
Make sure that exceptions which are thrown outside of the user code t…
Browse files Browse the repository at this point in the history
…ry their best to be handeled in ApplicationController#rescue_action.

This allos handling of ActionController::RoutingError which were previously always handeled by ActionController#Base


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5516 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
Tobias Lütke committed Nov 13, 2006
1 parent 4978d1d commit a64c6af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN* *SVN*


* Make sure that exceptions which are thrown outside of the user code try their best to be handeled in ApplicationController#rescue_action [Tobias Luetke]

* Rails::VERSION::STRING should always be available without having to require 'rails/version'. #6244 [fearoffish] * Rails::VERSION::STRING should always be available without having to require 'rails/version'. #6244 [fearoffish]


* Update to Prototype 1.5.0_rc2. [Sam Stephenson] * Update to Prototype 1.5.0_rc2. [Sam Stephenson]
Expand Down
3 changes: 2 additions & 1 deletion railties/lib/dispatcher.rb
Expand Up @@ -42,7 +42,8 @@ def dispatch(cgi = nil, session_options = ActionController::CgiRequest::DEFAULT_
end end
rescue Exception => exception # errors from CGI dispatch rescue Exception => exception # errors from CGI dispatch
failsafe_response(output, '500 Internal Server Error', exception) do failsafe_response(output, '500 Internal Server Error', exception) do
controller ||= const_defined?(:ApplicationController) ? ApplicationController : ActionController::Base controller ||= ApplicationController rescue LoadError nil
controller ||= ActionController::Base
controller.process_with_exception(request, response, exception).out(output) controller.process_with_exception(request, response, exception).out(output)
end end
ensure ensure
Expand Down

0 comments on commit a64c6af

Please sign in to comment.