Project

General

Profile

Feature #14688 » lib_net_http_exceptions_with_deprecate.patch

unasuke (Yusuke Nakamura), 05/10/2018 03:57 PM

View differences:

lib/net/http/exceptions.rb
# We cannot use the name "HTTPServerError", it is the name of the response.
include Net::HTTPExceptions
end
# for compatibility
Net::HTTPClientException = Net::HTTPServerException
class Net::HTTPFatalError < Net::ProtoFatalError
include Net::HTTPExceptions
end
module Net
deprecate_constant(:HTTPServerException)
deprecate_constant(:ProtoServerError)
end
test/net/http/test_httpresponse.rb
res = Net::HTTPResponse.read_new(io)
assert_equal(nil, res.message)
assert_raise Net::HTTPServerException do
assert_raise Net::HTTPClientException do
res.error!
end
end
(2-2/2)