Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unrescued ActiveRecord::RecordNotFound responds with 404 instead of 500.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5706 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit a454dcf012e13f24c6c74098f9fd4efd72e8aadc 1 parent 906bd93
@jeremy jeremy authored
View
2  actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Unrescued ActiveRecord::RecordNotFound responds with 404 instead of 500. [Jeremy Kemper]
+
* Improved auto_link to match more valid urls correctly [Tobias Luetke]
* Add singleton resources. [Rick Olson]
View
3  actionpack/lib/action_controller/rescue.rb
@@ -11,7 +11,8 @@ module Rescue
DEFAULT_RESCUE_RESPONSE = :internal_server_error
DEFAULT_RESCUE_RESPONSES = {
'ActionController::RoutingError' => :not_found,
- 'ActionController::UnknownAction' => :not_found
+ 'ActionController::UnknownAction' => :not_found,
+ 'ActiveRecord::RecordNotFound' => :not_found
}
DEFAULT_RESCUE_TEMPLATE = 'diagnostics'
View
1  actionpack/test/controller/rescue_test.rb
@@ -143,6 +143,7 @@ def test_rescue_responses
assert_equal :not_found, responses[ActionController::RoutingError.name]
assert_equal :not_found, responses[ActionController::UnknownAction.name]
+ assert_equal :not_found, responses['ActiveRecord::RecordNotFound']
end
def test_rescue_templates
Please sign in to comment.
Something went wrong with that request. Please try again.