Skip to content

Commit 0e3d405

Browse files
committed
Changes
1 parent b600ddf commit 0e3d405

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/Application/Websocket/Application.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ public function onMessage(TcpConnection $tcpConnection, string $payload): void {
100100
try {
101101
$this->container->get(OnMessageInterface::class)->handle($client, $this->hydrator->create(Message::class, $payloadArray));
102102
} catch (Throwable $exception) {
103-
print $exception->getMessage() . "\n";
104103
$this->logger->error($exception->getMessage(), [
105104
'payload' => $payloadArray,
106105
'exception' => $exception,
@@ -111,11 +110,15 @@ public function onMessage(TcpConnection $tcpConnection, string $payload): void {
111110
/**
112111
* @param TcpConnection $tcpConnection
113112
* @throws ContainerExceptionInterface
114-
* @throws NotFoundException
115113
* @throws NotFoundExceptionInterface
116114
*/
117115
public function onClose(TcpConnection $tcpConnection): void {
118-
$client = $this->collection->get($tcpConnection->id);
116+
try {
117+
$client = $this->collection->get($tcpConnection->id);
118+
} catch (NotFoundException $e) {
119+
print_r("Client not found on close: " . $tcpConnection->id . "\n");
120+
return;
121+
}
119122
$this->collection->remove($client->id);
120123
$this->container->get(OnCloseInterface::class)->handle($client);
121124
}

src/Application/Websocket/Event/OnConnect.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function handle(Client $client): void {
2828
try {
2929
$this->registerService->register($client);
3030
} catch (Throwable $e) {
31-
print_r($e->getMessage());
3231
$client->connection->close(['error' => 'Server error occurred during registration.']);
3332
return;
3433
}

src/Application/Websocket/Service/Brain/ReflectionService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public function handle(Client $client, Message $payload): void {
2828

2929
$code = $this->brain->reflection($client, $payload->payload['query']);
3030

31+
print_r($code);
32+
3133
if (!str_ends_with($code, ';')) {
3234
$code .= ';';
3335
}

0 commit comments

Comments
 (0)