Skip to content

Commit

Permalink
Throwable 转换
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Jul 26, 2018
1 parent 57dc0e6 commit 71bca14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/daemon/commands/SingleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function startWork()
{
try {
$this->work();
} catch (\Exception $e) {
} catch (\Throwable $e) {
// 处理异常
Error::handleException($e);
// 休息一会,避免 CPU 出现 100%
Expand Down
4 changes: 2 additions & 2 deletions apps/websocketd/commands/ServiceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function onOpen(\Swoole\WebSocket\Server $webSocket, $fd, \mix\http\Reque
if ($type == 'message') {
$webSocket->push($fd, $message);
}
} catch (\Exception $e) {
} catch (\Throwable $e) {
// 处理异常
Error::handleException($e);
}
Expand All @@ -170,7 +170,7 @@ public function onOpen(\Swoole\WebSocket\Server $webSocket, $fd, \mix\http\Reque
// 订阅该用户id的消息队列
$channels[] = 'emit_to_' . $userinfo['uid'];
call_user_func_array([$client, 'subscribe'], $channels);
} catch (\Exception $e) {
} catch (\Throwable $e) {
// 处理异常
Error::handleException($e);
// 关闭 WS 连接
Expand Down

0 comments on commit 71bca14

Please sign in to comment.