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

Add Net::HTTPClientException [Bug #14688]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2018-06-06 09:01:04 +00:00
parent 685fdbe64c
commit 8e37f17671
3 changed files with 14 additions and 1 deletions

5
NEWS
View file

@ -159,6 +159,11 @@ with all sufficient information, see the ChangeLog file or Redmine
* Add Net::BufferedIO#write_timeout, Net::BufferedIO#write_timeout=, * Add Net::BufferedIO#write_timeout, Net::BufferedIO#write_timeout=,
Net::HTTP#write_timeout, and Net::HTTP#write_timeout=. [Feature #13396] Net::HTTP#write_timeout, and Net::HTTP#write_timeout=. [Feature #13396]
* New constant:
* Add Net::HTTPClientException to deprecate Net::HTTPServerException,
whose name is misleading. [Bug #14688]
* REXML * REXML
* Improved some XPath implementations: * Improved some XPath implementations:

View file

@ -20,7 +20,15 @@ class Net::HTTPServerException < Net::ProtoServerError
# We cannot use the name "HTTPServerError", it is the name of the response. # We cannot use the name "HTTPServerError", it is the name of the response.
include Net::HTTPExceptions include Net::HTTPExceptions
end end
# for compatibility
Net::HTTPClientException = Net::HTTPServerException
class Net::HTTPFatalError < Net::ProtoFatalError class Net::HTTPFatalError < Net::ProtoFatalError
include Net::HTTPExceptions include Net::HTTPExceptions
end end
module Net
deprecate_constant(:HTTPServerException)
deprecate_constant(:ProtoServerError)
end

View file

@ -422,7 +422,7 @@ EOS
res = Net::HTTPResponse.read_new(io) res = Net::HTTPResponse.read_new(io)
assert_equal(nil, res.message) assert_equal(nil, res.message)
assert_raise Net::HTTPServerException do assert_raise Net::HTTPClientException do
res.error! res.error!
end end
end end