lib/httpx/connection.rb in httpx-0.22.0 vs lib/httpx/connection.rb in httpx-0.22.1
- old
+ new
@@ -524,11 +524,17 @@
Errno::ECONNRESET,
Errno::EADDRNOTAVAIL,
Errno::EHOSTUNREACH,
Errno::EINVAL,
Errno::ENETUNREACH,
- Errno::EPIPE,
- TLSError => e
+ Errno::EPIPE => e
+ # connect errors, exit gracefully
+ error = ConnectionError.new(e.message)
+ error.set_backtrace(e.backtrace)
+ handle_error(error)
+ @state = :closed
+ emit(:close)
+ rescue TLSError => e
# connect errors, exit gracefully
handle_error(e)
@state = :closed
emit(:close)
end