Skip to content

Commit ed8996e

Browse files
author
Sören
committed
Error type
1 parent f89be2a commit ed8996e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ function ($key, $value) {
182182
$buffer = fgets($this->socket, 1024);
183183
if ($buffer === false) {
184184
$meta = stream_get_meta_data($this->socket);
185-
$message = 'Client handshake timeout';
185+
$message = 'Client handshake error';
186186
$this->logger->error($message, $meta);
187-
throw new TimeoutException($message, ConnectionException::TIMED_OUT, $meta);
187+
throw new ConnectionException($message);
188188
}
189189
$response .= $buffer;
190190
} while (substr_count($response, "\r\n\r\n") == 0);

tests/ClientTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ public function testBrokenRead(): void
352352
$client->receive();
353353
}
354354

355-
public function testHandshakeTimeout(): void
355+
public function testHandshakeError(): void
356356
{
357-
MockSocket::initialize('client.connect-handshake-timeout', $this);
357+
MockSocket::initialize('client.connect-handshake-error', $this);
358358
$client = new Client('ws://localhost:8000/my/mock/path');
359-
$this->expectException('WebSocket\TimeoutException');
360-
$this->expectExceptionCode(1024);
361-
$this->expectExceptionMessage('Client handshake timeout');
359+
$this->expectException('WebSocket\ConnectionException');
360+
$this->expectExceptionCode(0);
361+
$this->expectExceptionMessage('Client handshake error');
362362
$client->send('Connect');
363363
}
364364

0 commit comments

Comments
 (0)