Modify exceptions info for matching php behavior
@@ -371,7 +371,11 @@ static PHP_METHOD(Swow_Socket, connect)
ret = cat_socket_connect_ex(socket, ZSTR_VAL(name), ZSTR_LEN(name), port, timeout);
if (UNEXPECTED(!ret)) {
- swow_throw_exception_with_last(swow_socket_exception_ce);
+ swow_throw_exception(
+ swow_socket_exception_ce,
+ cat_get_last_error_code(),
+ strerror(cat_orig_errno(cat_get_last_error_code()))
+ );
RETURN_THROWS();
}
