Skip to content

Commit 81bf1d0

Browse files
nevanschrisarcand
authored andcommitted
Reraise broken connection as HTTPConnectionError
These exceptions are copied from the list of exceptions which Net::HTTP uses in `#transport_request` to determin whether the socket should be closed (and retried, for idempotent requests).
1 parent b42e72d commit 81bf1d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/vault/client.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ class Client
5151
a << Errno::ECONNREFUSED
5252
a << Errno::EADDRNOTAVAIL
5353

54+
# Broken connection errors
55+
a << Errno::ECONNRESET
56+
a << Errno::ECONNABORTED
57+
a << Errno::EPIPE
58+
a << Errno::ETIMEDOUT
59+
a << OpenSSL::SSL::SSLError
60+
a << IOError
61+
5462
# Failed to read body or no response body given
5563
a << EOFError
5664

0 commit comments

Comments
 (0)