aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-06-19 21:09:41 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-10-10 01:35:58 -0300
commitb3d41eae4b138d6c9d38bd9c1cbe033802c0e21d (patch)
treeeb7514a733481a43f0f1ddc125f88bcbe76f9dfe /actionpack/lib/action_dispatch/http
parent53d2b7335af0fc14c3522cbceb54c0f28d35c3e0 (diff)
downloadrails-b3d41eae4b138d6c9d38bd9c1cbe033802c0e21d.tar.gz
rails-b3d41eae4b138d6c9d38bd9c1cbe033802c0e21d.tar.bz2
rails-b3d41eae4b138d6c9d38bd9c1cbe033802c0e21d.zip
Deprecated ActionDispatch::ParamsParser::ParamsParser
ActionDispatch::ParamsParser class was removed in favor of ActionDispatch::Http::Parameters so it is better to move the error constant to the new class.
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r--actionpack/lib/action_dispatch/http/parameters.rb14
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb2
2 files changed, 14 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb
index 31ef0af791..ddd15b748b 100644
--- a/actionpack/lib/action_dispatch/http/parameters.rb
+++ b/actionpack/lib/action_dispatch/http/parameters.rb
@@ -12,6 +12,14 @@ module ActionDispatch
}
}
+ # Raised when raw data from the request cannot be parsed by the parser
+ # defined for request's content mime type.
+ class ParseError < StandardError
+ def initialize
+ super($!.message)
+ end
+ end
+
included do
class << self
attr_reader :parameter_parsers
@@ -91,7 +99,7 @@ module ActionDispatch
my_logger = logger || ActiveSupport::Logger.new($stderr)
my_logger.debug "Error occurred while parsing request parameters.\nContents:\n\n#{raw_post}"
- raise ParamsParser::ParseError
+ raise ParseError
end
end
@@ -100,4 +108,8 @@ module ActionDispatch
end
end
end
+
+ module ParamsParser
+ ParseError = ActiveSupport::Deprecation::DeprecatedConstantProxy.new("ActionDispatch::ParamsParser::ParseError", "ActionDispatch::Http::Parameters::ParseError")
+ end
end
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index e4ef9783f3..9986d6e1e9 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -357,7 +357,7 @@ module ActionDispatch
end
self.request_parameters = Request::Utils.normalize_encode_params(pr)
end
- rescue ParamsParser::ParseError # one of the parse strategies blew up
+ rescue Http::Parameters::ParseError # one of the parse strategies blew up
self.request_parameters = Request::Utils.normalize_encode_params(super || {})
raise
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e