From f379d25e0f35b6c1fa18a3fa970aa7f12f9d0c53 Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto Date: Sat, 11 Apr 2015 17:06:08 +0900 Subject: [PATCH 1/2] * lib/net/http/response.rb (Net::HTTPResponse#inflater): fix TypeError. An exception object might be nil. --- lib/net/http/response.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb index b073169..57661ca 100644 --- a/lib/net/http/response.rb +++ b/lib/net/http/response.rb @@ -259,11 +259,11 @@ def inflater # :nodoc: 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 -- 1.9.1