Skip to content

Commit 925d2db

Browse files
committed
Merge branch 'master' into 2.1-merge
2 parents 85d95c0 + e9adfb7 commit 925d2db

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Server.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ public function onMessage($server, Frame $frame): void
231231
return;
232232
}
233233

234-
$instance->onMessage($server, $frame);
234+
try {
235+
$instance->onMessage($server, $frame);
236+
} catch (\Throwable $exception) {
237+
$this->logger->error((string) $exception);
238+
}
235239
}
236240

237241
public function onClose($server, int $fd, int $reactorId): void
@@ -252,7 +256,11 @@ public function onClose($server, int $fd, int $reactorId): void
252256

253257
$instance = $this->container->get($fdObj->class);
254258
if ($instance instanceof OnCloseInterface) {
255-
$instance->onClose($server, $fd, $reactorId);
259+
try {
260+
$instance->onClose($server, $fd, $reactorId);
261+
} catch (\Throwable $exception) {
262+
$this->logger->error((string) $exception);
263+
}
256264
}
257265
}
258266

0 commit comments

Comments
 (0)