From a454dcf012e13f24c6c74098f9fd4efd72e8aadc Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 8 Dec 2006 22:19:00 +0000 Subject: 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 --- actionpack/lib/action_controller/rescue.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb index 08ee699f7f..01969e867c 100644 --- a/actionpack/lib/action_controller/rescue.rb +++ b/actionpack/lib/action_controller/rescue.rb @@ -11,7 +11,8 @@ module ActionController #:nodoc: 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' -- cgit v1.2.3