aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorYuki Nishijima <mail@yukinishijima.net>2014-09-13 16:54:20 -0700
committerYuki Nishijima <mail@yukinishijima.net>2014-09-13 16:54:20 -0700
commit75eaefcc2f7c7526be389702c4802a73d4d934e9 (patch)
tree84f03a1da20d174e8d884f083ea3762697d123f4 /actionpack/lib/action_dispatch
parent516f431ab0618a052f53eb5b14e2c6204da244dd (diff)
downloadrails-75eaefcc2f7c7526be389702c4802a73d4d934e9.tar.gz
rails-75eaefcc2f7c7526be389702c4802a73d4d934e9.tar.bz2
rails-75eaefcc2f7c7526be389702c4802a73d4d934e9.zip
Rescue Rack::Utils::ParameterTypeError instead of TypeError
As of rack/rack@167b6480235ff00ed5f355698bf00ec2f250f72e, Rack raises Rack::Utils::ParameterTypeError which inherits TypeError. In terms of the behavior, Rescuing TypeError still works but this method shouldn't rescue if TypeError is raised for other reasons.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index c441f7f95b..e854dd266c 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -298,7 +298,7 @@ module ActionDispatch
# Override Rack's GET method to support indifferent access
def GET
@env["action_dispatch.request.query_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {}))
- rescue TypeError, Rack::Utils::InvalidParameterError => e
+ rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:query, e)
end
alias :query_parameters :GET
@@ -306,7 +306,7 @@ module ActionDispatch
# Override Rack's POST method to support indifferent access
def POST
@env["action_dispatch.request.request_parameters"] ||= Utils.deep_munge(normalize_encode_params(super || {}))
- rescue TypeError, Rack::Utils::InvalidParameterError => e
+ rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new(:request, e)
end
alias :request_parameters :POST