Skip to content

Commit 0e63d30

Browse files
authored
Merge pull request #84 from clue-labs/exception
Remove superfluous and undocumented ConnectionException
2 parents 3473047 + c9b7f22 commit 0e63d30

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ $tcpConnector = new React\SocketClient\TcpConnector($loop, array(
212212
```
213213

214214
Note that this class only allows you to connect to IP-port-combinations.
215+
If the given URI is invalid, does not contain a valid IP address and port
216+
or contains any other scheme, it will reject with an
217+
`InvalidArgumentException`:
218+
219+
If the given URI appears to be valid, but connecting to it fails (such as if
220+
the remote host rejects the connection etc.), it will reject with a
221+
`RuntimeException`.
222+
215223
If you want to connect to hostname-port-combinations, see also the following chapter.
216224

217225
### DNS resolution

src/ConnectionException.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/TcpConnector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function checkConnectedSocket($socket)
8787
if (false === stream_socket_get_name($socket, true)) {
8888
fclose($socket);
8989

90-
return Promise\reject(new ConnectionException('Connection refused'));
90+
return Promise\reject(new \RuntimeException('Connection refused'));
9191
}
9292

9393
return Promise\resolve($socket);

0 commit comments

Comments
 (0)