1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated code in ActionDispatch::ParamsParser::ParseError

This commit is contained in:
Rafael Mendonça França 2016-06-19 20:49:52 -04:00
parent 2a3718f434
commit 1740610a08
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948
2 changed files with 10 additions and 17 deletions

View file

@ -1,3 +1,12 @@
* 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.
*Rafael Mendonça França*

View file

@ -10,25 +10,9 @@ 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(message = nil, original_exception = nil)
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
def initialize
super($!.message)
end
def original_exception
ActiveSupport::Deprecation.warn("#original_exception is deprecated. Use #cause instead.", caller)
cause
end
end
# Create a new +ParamsParser+ middleware instance.