mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-06 00:02:08 -04:00
rescue from IOError and terminate the connection
contrary to what was probably assumed, IOError is not a SocketError... Closes #295
This commit is contained in:
parent
dd0473e7cf
commit
5a08853e7a
@ -522,7 +522,8 @@ module HTTPX
|
||||
Errno::ENETUNREACH,
|
||||
Errno::EPIPE,
|
||||
Errno::ENOENT,
|
||||
SocketError => e
|
||||
SocketError,
|
||||
IOError => e
|
||||
# connect errors, exit gracefully
|
||||
error = ConnectionError.new(e.message)
|
||||
error.set_backtrace(e.backtrace)
|
||||
|
@ -78,7 +78,8 @@ module HTTPX
|
||||
rescue Errno::ECONNREFUSED,
|
||||
Errno::EADDRNOTAVAIL,
|
||||
Errno::EHOSTUNREACH,
|
||||
SocketError => e
|
||||
SocketError,
|
||||
IOError => e
|
||||
raise e if @ip_index <= 0
|
||||
|
||||
log { "failed connecting to #{@ip} (#{e.message}), trying next..." }
|
||||
|
Loading…
x
Reference in New Issue
Block a user