aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2020-07-23 11:11:12 +0900
committernagachika <nagachika@ruby-lang.org>2020-07-23 11:11:12 +0900
commitcc39480cf9f2767967b6bcc69ccb3c201e5b2231 (patch)
tree5ee3a66257e3a51c99e980d41e2e813c4cfc96bf /lib
parentd24cce8e7f48b0b45f726f5f1ac7ff796f46ba72 (diff)
downloadruby-cc39480cf9f2767967b6bcc69ccb3c201e5b2231.tar.gz
merge revision(s) 5a79d8e0507cd143100bf928a88a59a8b5a5bca6,160511d851375f7cb922faae3a9310633187f51f: [Backport #16925]
Fix error raised by Net::HTTPResponse#inflater if the block raises * See https://bugs.ruby-lang.org/issues/13882#note-6 Quarantine specs which fail frequently with CHECK_LEAKS=true
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http/response.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb
index 5a94f95694..08eaeb2cac 100644
--- a/lib/net/http/response.rb
+++ b/lib/net/http/response.rb
@@ -268,12 +268,13 @@ class Net::HTTPResponse
begin
yield inflate_body_io
+ success = true
ensure
- orig_err = $!
begin
inflate_body_io.finish
rescue => err
- raise orig_err || err
+ # Ignore #finish's error if there is an exception from yield
+ raise err if success
end
end
when 'none', 'identity' then