Remove deprecated code in ActionDispatch::ParamsParser::ParseError

上级 2a3718f4
* Remove deprecated `original_exception` and `message` arguments in
`ActionDispatch::ParamsParser::ParseError#initialize`.
*Rafael Mendonça França*
* Remove deprecated `#original_exception` in `ActionDispatch::ParamsParser::ParseError`.
*Rafael Mendonça França*
* Remove deprecated access to mime types through constants. * Remove deprecated access to mime types through constants.
*Rafael Mendonça França* *Rafael Mendonça França*
......
...@@ -10,25 +10,9 @@ class ParamsParser ...@@ -10,25 +10,9 @@ class ParamsParser
# Raised when raw data from the request cannot be parsed by the parser # Raised when raw data from the request cannot be parsed by the parser
# defined for request's content mime type. # defined for request's content mime type.
class ParseError < StandardError class ParseError < StandardError
def initialize(message = nil, original_exception = nil) def initialize
if message
ActiveSupport::Deprecation.warn("Passing #message is deprecated and has no effect. " \
"#{self.class} will automatically capture the message " \
"of the original exception.", caller)
end
if original_exception
ActiveSupport::Deprecation.warn("Passing #original_exception is deprecated and has no effect. " \
"Exceptions will automatically capture the original exception.", caller)
end
super($!.message) super($!.message)
end end
def original_exception
ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller)
cause
end
end end
# Create a new +ParamsParser+ middleware instance. # Create a new +ParamsParser+ middleware instance.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册