diff options
author | Tobias Lütke <tobias.luetke@gmail.com> | 2006-11-13 20:23:00 +0000 |
---|---|---|
committer | Tobias Lütke <tobias.luetke@gmail.com> | 2006-11-13 20:23:00 +0000 |
commit | a64c6af57c4edc34a3e20783d05fcab07952bcbc (patch) | |
tree | e56674ce275e8ffb51d34d134b978820ddd72a60 /railties/lib/dispatcher.rb | |
parent | 4978d1dce781f7ab81826cec5e3df4ae2cfd1bd7 (diff) | |
download | rails-a64c6af57c4edc34a3e20783d05fcab07952bcbc.tar.gz rails-a64c6af57c4edc34a3e20783d05fcab07952bcbc.tar.bz2 rails-a64c6af57c4edc34a3e20783d05fcab07952bcbc.zip |
Make sure that exceptions which are thrown outside of the user code try 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
Diffstat (limited to 'railties/lib/dispatcher.rb')
-rw-r--r-- | railties/lib/dispatcher.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index be2f54a04c..1d604bc254 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -42,7 +42,8 @@ class Dispatcher end rescue Exception => exception # errors from CGI dispatch 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) end ensure |