@@ -28,15 +28,15 @@ public function connect($uri)
2828 $ parts = \parse_url ($ uri );
2929 if (!$ parts || !isset ($ parts ['scheme ' ], $ parts ['host ' ], $ parts ['port ' ]) || $ parts ['scheme ' ] !== 'tcp ' ) {
3030 return Promise \reject (new \InvalidArgumentException (
31- 'Given URI " ' . $ uri . '" is invalid ' ,
31+ 'Given URI " ' . $ uri . '" is invalid (EINVAL) ' ,
3232 \defined ('SOCKET_EINVAL ' ) ? \SOCKET_EINVAL : 22
3333 ));
3434 }
3535
3636 $ ip = \trim ($ parts ['host ' ], '[] ' );
3737 if (false === \filter_var ($ ip , \FILTER_VALIDATE_IP )) {
3838 return Promise \reject (new \InvalidArgumentException (
39- 'Given URI " ' . $ uri . '" does not contain a valid host IP ' ,
39+ 'Given URI " ' . $ uri . '" does not contain a valid host IP (EINVAL) ' ,
4040 \defined ('SOCKET_EINVAL ' ) ? \SOCKET_EINVAL : 22
4141 ));
4242 }
@@ -91,7 +91,7 @@ public function connect($uri)
9191
9292 if (false === $ stream ) {
9393 return Promise \reject (new \RuntimeException (
94- \sprintf ( " Connection to %s failed: %s " , $ uri , $ errstr ),
94+ ' Connection to ' . $ uri . ' failed: ' . $ errstr . SocketServer:: errconst ( $ errno ),
9595 $ errno
9696 ));
9797 }
@@ -132,7 +132,7 @@ public function connect($uri)
132132
133133 \fclose ($ stream );
134134 $ reject (new \RuntimeException (
135- 'Connection to ' . $ uri . ' failed: ' . $ errstr ,
135+ 'Connection to ' . $ uri . ' failed: ' . $ errstr . SocketServer:: errconst ( $ errno ) ,
136136 $ errno
137137 ));
138138 } else {
@@ -151,7 +151,7 @@ public function connect($uri)
151151 // @codeCoverageIgnoreEnd
152152
153153 throw new \RuntimeException (
154- 'Connection to ' . $ uri . ' cancelled during TCP/IP handshake ' ,
154+ 'Connection to ' . $ uri . ' cancelled during TCP/IP handshake (ECONNABORTED) ' ,
155155 \defined ('SOCKET_ECONNABORTED ' ) ? \SOCKET_ECONNABORTED : 103
156156 );
157157 });
0 commit comments