Feature #14688 » lib_net_http_exceptions_with_deprecate.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
|
||
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
|
- « Previous
- 1
- 2
- Next »