summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/http.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 7dd1f24d4c..869773bc92 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1055,6 +1055,10 @@ module Net #:nodoc:
end_transport req, res
res
+ rescue => exception
+ D "Conn close because of error #{exception}"
+ @socket.close unless @socket.closed?
+ raise exception
end
private