ruby-changes:34600
From: naruse <ko1@a...>
Date: Fri, 4 Jul 2014 04:46:50 +0900 (JST)
Subject: [ruby-changes:34600] naruse:r46681 (trunk): * lib/net/http/response.rb (Net::HTTP.each_response_header):
naruse 2014-07-04 04:46:34 +0900 (Fri, 04 Jul 2014) New Revision: 46681 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46681 Log: * lib/net/http/response.rb (Net::HTTP.each_response_header): raise first exception even if inflate_body_io.finish raises error. when begin block raises error, finish usually raises error too. Modified files: trunk/ChangeLog trunk/lib/net/http/response.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 46680) +++ ChangeLog (revision 46681) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Jul 4 04:39:52 2014 NARUSE, Yui <naruse@r...> + + * lib/net/http/response.rb (Net::HTTPResponse.each_response_header): + raise first exception even if inflate_body_io.finish raises error. + when begin block raises error, finish usually raises error too. + Fri Jul 4 02:56:04 2014 NARUSE, Yui <naruse@r...> * lib/uri/generic.rb (URI::Generic#query=): remove validation, just Index: lib/net/http/response.rb =================================================================== --- lib/net/http/response.rb (revision 46680) +++ lib/net/http/response.rb (revision 46681) @@ -259,7 +259,12 @@ class Net::HTTPResponse https://github.com/ruby/ruby/blob/trunk/lib/net/http/response.rb#L259 begin yield inflate_body_io ensure - inflate_body_io.finish + e = $! + begin + inflate_body_io.finish + rescue + raise e + end end when 'none', 'identity' then self.delete 'content-encoding' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/