aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/parameters.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/http/parameters.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/parameters.rb14
1 files changed, 13 insertions, 1 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