diff options
Diffstat (limited to 'lib/net/http/response.rb')
-rw-r--r-- | lib/net/http/response.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb index 66132985d9..ca0a6eb379 100644 --- a/lib/net/http/response.rb +++ b/lib/net/http/response.rb @@ -262,12 +262,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 |