Skip to content

Commit 3e59c65

Browse files
committed
don't throw an error on success case (error code 0)
1 parent 8bd9a8b commit 3e59c65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/connection/Socket.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ private function throwConnectException(): void
153153
if ($timediff >= $this->timeout) {
154154
throw ConnectionTimeoutException::createFromTimeout($this->timeout);
155155
}
156+
} else if ($code !== 0) {
157+
throw new ConnectException(socket_strerror($code), $code);
156158
}
157-
throw new ConnectException(socket_strerror($code), $code);
158159
}
159160
}

0 commit comments

Comments
 (0)