aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r--actionpack/lib/action_dispatch/middleware/params_parser.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/params_parser.rb b/actionpack/lib/action_dispatch/middleware/params_parser.rb
index 1cb803ffb9..7f38c6d4f3 100644
--- a/actionpack/lib/action_dispatch/middleware/params_parser.rb
+++ b/actionpack/lib/action_dispatch/middleware/params_parser.rb
@@ -4,6 +4,8 @@ require 'active_support/core_ext/hash/indifferent_access'
module ActionDispatch
class ParamsParser
+ class ParseError < StandardError; end
+
DEFAULT_PARSERS = {
Mime::XML => :xml_simple,
Mime::JSON => :json
@@ -52,9 +54,10 @@ module ActionDispatch
false
end
rescue Exception => e # YAML, XML or Ruby code block errors
- logger(env).debug "Error occurred while parsing request parameters.\nContents:\n\n#{request.raw_post}"
+ message = "Error occurred while parsing request parameters.\nContents:\n\n#{request.raw_post}"
+ logger(env).debug message
- raise e
+ raise ParseError, message
end
def content_type_from_legacy_post_data_format_header(env)