Skip to content

Commit

Permalink
Expose error code in exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Sep 12, 2017
1 parent f8275ce commit 2d76d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function listen(string $uri, ServerListenContext $socketContext = null, ServerTl
$server = @\stream_socket_server($uri, $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context);

if (!$server || $errno) {
throw new SocketException(\sprintf("Could not create server %s: [Error: #%d] %s", $uri, $errno, $errstr));
throw new SocketException(\sprintf("Could not create server %s: [Error: #%d] %s", $uri, $errno, $errstr), $errno);
}

return new Server($server, 65536);
Expand Down Expand Up @@ -104,7 +104,7 @@ function connect(string $uri, ClientConnectContext $socketContext = null, Cancel
$uri,
$errno,
$errstr
));
), $errno);
}

\stream_set_blocking($socket, false);
Expand Down

0 comments on commit 2d76d7f

Please sign in to comment.