Project

General

Profile

Feature #14688 » lib_net_http_exceptions.patch

unasuke (Yusuke Nakamura), 04/15/2018 01:35 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
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
(1-1/2)