File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,10 @@ class SSL < Socket
5454 # @since 2.0.0
5555 def connect!
5656 Timeout . timeout ( timeout , Error ::SocketTimeoutError ) do
57- @tcp_socket . connect ( ::Socket . pack_sockaddr_in ( port , host ) )
57+ handle_errors { @tcp_socket . connect ( ::Socket . pack_sockaddr_in ( port , host ) ) }
5858 @socket = OpenSSL ::SSL ::SSLSocket . new ( @tcp_socket , context )
5959 @socket . sync_close = true
60- @socket . connect
60+ handle_errors { @socket . connect }
6161 verify_certificate! ( @socket )
6262 self
6363 end
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class TCP < Socket
4343 def connect!
4444 Timeout . timeout ( timeout , Error ::SocketTimeoutError ) do
4545 socket . setsockopt ( IPPROTO_TCP , TCP_NODELAY , 1 )
46- socket . connect ( ::Socket . pack_sockaddr_in ( port , host ) )
46+ handle_errors { socket . connect ( ::Socket . pack_sockaddr_in ( port , host ) ) }
4747 self
4848 end
4949 end
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class Unix < Socket
3939 # @since 2.0.0
4040 def connect!
4141 Timeout . timeout ( timeout , Error ::SocketTimeoutError ) do
42- socket . connect ( path )
42+ handle_errors { socket . connect ( path ) }
4343 self
4444 end
4545 end
You can’t perform that action at this time.
0 commit comments