summaryrefslogtreecommitdiff
path: root/lib/net/http/response.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/http/response.rb')
-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