Skip to content
This repository
Browse code

Make sure that exceptions which are thrown outside of the user code t…

…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...
commit a64c6af57c4edc34a3e20783d05fcab07952bcbc 1 parent 4978d1d
Tobias Lütke authored

Showing 2 changed files with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 0  railties/CHANGELOG
  2. +2 1  railties/lib/dispatcher.rb
2  railties/CHANGELOG
... ... @@ -1,5 +1,7 @@
1 1 *SVN*
2 2
  3 +* Make sure that exceptions which are thrown outside of the user code try their best to be handeled in ApplicationController#rescue_action [Tobias Luetke]
  4 +
3 5 * Rails::VERSION::STRING should always be available without having to require 'rails/version'. #6244 [fearoffish]
4 6
5 7 * Update to Prototype 1.5.0_rc2. [Sam Stephenson]
3  railties/lib/dispatcher.rb
@@ -42,7 +42,8 @@ def dispatch(cgi = nil, session_options = ActionController::CgiRequest::DEFAULT_
42 42 end
43 43 rescue Exception => exception # errors from CGI dispatch
44 44 failsafe_response(output, '500 Internal Server Error', exception) do
45   - controller ||= const_defined?(:ApplicationController) ? ApplicationController : ActionController::Base
  45 + controller ||= ApplicationController rescue LoadError nil
  46 + controller ||= ActionController::Base
46 47 controller.process_with_exception(request, response, exception).out(output)
47 48 end
48 49 ensure

0 comments on commit a64c6af

Please sign in to comment.
Something went wrong with that request. Please try again.