diff options
author | Grey Baker <greysteil@gmail.com> | 2015-04-02 11:40:34 +0100 |
---|---|---|
committer | Grey Baker <greysteil@gmail.com> | 2015-06-12 23:44:20 +0100 |
commit | 0a9b86b0c096d67d22f597d4ef187853b7d210e6 (patch) | |
tree | d39bf2245a4e8a2a113a8c57cab8c10ef6bb6e53 | |
parent | 22e39f8b658c5823411f93f86f35acfd0eb226cd (diff) | |
download | rails-0a9b86b0c096d67d22f597d4ef187853b7d210e6.tar.gz rails-0a9b86b0c096d67d22f597d4ef187853b7d210e6.tar.bz2 rails-0a9b86b0c096d67d22f597d4ef187853b7d210e6.zip |
Handle param-parsing errors from Rack in ExceptionWrapper
-rw-r--r-- | actionpack/CHANGELOG.md | 6 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/exception_wrapper.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 7b2f150c67..78ae506389 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,9 @@ +* Adds`Rack::Utils::ParameterTypeError` and `Rack::Utils::InvalidParameterError` + to the rescue_responses hash in `ExceptionWrapper` (Rack recommends + integrators serve 400s for both of these). + + *Grey Baker* + * Add support for API only apps. ActionController::API is added as a replacement of ActionController::Base for this kind of applications. diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb index d176a73633..8c3d45584d 100644 --- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb @@ -17,7 +17,9 @@ module ActionDispatch 'ActionController::InvalidCrossOriginRequest' => :unprocessable_entity, 'ActionDispatch::ParamsParser::ParseError' => :bad_request, 'ActionController::BadRequest' => :bad_request, - 'ActionController::ParameterMissing' => :bad_request + 'ActionController::ParameterMissing' => :bad_request, + 'Rack::Utils::ParameterTypeError' => :bad_request, + 'Rack::Utils::InvalidParameterError' => :bad_request ) cattr_accessor :rescue_templates |