Feature #14688 » lib_net_http_exceptions.patch
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
|