[前][次][番号順一覧][スレッド一覧]

ruby-changes:39383

From: ktsj <ko1@a...>
Date: Sat, 1 Aug 2015 17:23:05 +0900 (JST)
Subject: [ruby-changes:39383] ktsj:r51464 (trunk): * lib/net/http/response.rb (Net::HTTPResponse#inflater):

ktsj	2015-08-01 17:22:50 +0900 (Sat, 01 Aug 2015)

  New Revision: 51464

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51464

  Log:
    * lib/net/http/response.rb (Net::HTTPResponse#inflater):
      fix TypeError. An exception object might be nil.
      [ruby-core:68846] [Bug #11058]

  Modified files:
    trunk/ChangeLog
    trunk/lib/net/http/response.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51463)
+++ ChangeLog	(revision 51464)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Aug  1 17:05:18 2015  Kazuki Tsujimoto  <kazuki@c...>
+
+	* lib/net/http/response.rb (Net::HTTPResponse#inflater):
+	  fix TypeError. An exception object might be nil.
+	  [ruby-core:68846] [Bug #11058]
+
 Sat Aug  1 09:09:46 2015  Aaron Patterson <tenderlove@r...>
 
 	* ext/openssl/ossl_ssl.c (ossl_sslctx_setup): Implement
Index: lib/net/http/response.rb
===================================================================
--- lib/net/http/response.rb	(revision 51463)
+++ lib/net/http/response.rb	(revision 51464)
@@ -260,11 +260,11 @@ class Net::HTTPResponse https://github.com/ruby/ruby/blob/trunk/lib/net/http/response.rb#L260
       begin
         yield inflate_body_io
       ensure
-        e = $!
+        orig_err = $!
         begin
           inflate_body_io.finish
-        rescue
-          raise e
+        rescue => err
+          raise orig_err || err
         end
       end
     when 'none', 'identity' then

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]