ruby-changes:51384
From: naruse <ko1@a...>
Date: Wed, 6 Jun 2018 18:01:09 +0900 (JST)
Subject: [ruby-changes:51384] naruse:r63590 (trunk): Add Net::HTTPClientException [Bug #14688]
naruse 2018-06-06 18:01:04 +0900 (Wed, 06 Jun 2018) New Revision: 63590 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63590 Log: Add Net::HTTPClientException [Bug #14688] Modified files: trunk/NEWS trunk/lib/net/http/exceptions.rb trunk/test/net/http/test_httpresponse.rb Index: lib/net/http/exceptions.rb =================================================================== --- lib/net/http/exceptions.rb (revision 63589) +++ lib/net/http/exceptions.rb (revision 63590) @@ -20,7 +20,15 @@ class Net::HTTPServerException < Net::Pr https://github.com/ruby/ruby/blob/trunk/lib/net/http/exceptions.rb#L20 # 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 Index: NEWS =================================================================== --- NEWS (revision 63589) +++ NEWS (revision 63590) @@ -159,6 +159,11 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L159 * Add Net::BufferedIO#write_timeout, Net::BufferedIO#write_timeout=, 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 * Improved some XPath implementations: Index: test/net/http/test_httpresponse.rb =================================================================== --- test/net/http/test_httpresponse.rb (revision 63589) +++ test/net/http/test_httpresponse.rb (revision 63590) @@ -422,7 +422,7 @@ EOS https://github.com/ruby/ruby/blob/trunk/test/net/http/test_httpresponse.rb#L422 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/