aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/rescue.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-12-22 00:27:39 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-12-22 00:27:39 +0000
commita1ca37ec8659800e5620630490ee8fa46bb3a217 (patch)
treec6915335cbe920b96fcf7a9b5dc2be6c5ac24b0b /actionpack/lib/action_controller/rescue.rb
parentbc3d150386ccc5844aa895d90e2cf525068310d9 (diff)
downloadrails-a1ca37ec8659800e5620630490ee8fa46bb3a217.tar.gz
rails-a1ca37ec8659800e5620630490ee8fa46bb3a217.tar.bz2
rails-a1ca37ec8659800e5620630490ee8fa46bb3a217.zip
Use 400 Bad Request status for unrescued ActiveRecord::RecordInvalid exceptions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/rescue.rb')
-rw-r--r--actionpack/lib/action_controller/rescue.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb
index 035047085d..e0107c5050 100644
--- a/actionpack/lib/action_controller/rescue.rb
+++ b/actionpack/lib/action_controller/rescue.rb
@@ -12,7 +12,8 @@ module ActionController #:nodoc:
DEFAULT_RESCUE_RESPONSES = {
'ActionController::RoutingError' => :not_found,
'ActionController::UnknownAction' => :not_found,
- 'ActiveRecord::RecordNotFound' => :not_found
+ 'ActiveRecord::RecordNotFound' => :not_found,
+ 'ActiveRecord::RecordInvalid' => :bad_request
}
DEFAULT_RESCUE_TEMPLATE = 'diagnostics'