I better error display
This commit is contained in:
parent
4f0dd41028
commit
9e85f2c457
|
|
@ -255,8 +255,7 @@ class Controller
|
|||
? $trace[0]['line']
|
||||
: null;
|
||||
|
||||
// log
|
||||
Log::channel('websocket')->error('Send error: ' . $p['data']['message'], $p);
|
||||
Log::channel('websocket')->error('Send error: ' . @$p['data']['message'], $p);
|
||||
|
||||
if (get_class($this->connection) === MockConnection::class) {
|
||||
$connection = clone $this->connection;
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ class Handler implements MessageComponentInterface
|
|||
ConnectionInterface $connection,
|
||||
MessageInterface $message
|
||||
) {
|
||||
try {
|
||||
if (! isset($connection->app)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -121,21 +122,6 @@ class Handler implements MessageComponentInterface
|
|||
Log::channel('websocket')->info('Executing event: '.$message['event']);
|
||||
|
||||
if (strpos($message['event'], 'pusher') !== false) {
|
||||
// try {
|
||||
// return Controller::controll_message(
|
||||
// $connection,
|
||||
// $channel,
|
||||
// $message,
|
||||
// $this->channelManager
|
||||
// );
|
||||
// } catch (Exception $e) {
|
||||
// return $connection->send(json_encode([
|
||||
// 'event' => $message['event'].':error',
|
||||
// 'data' => [
|
||||
// 'message' => $e->getMessage(),
|
||||
// ],
|
||||
// ]));
|
||||
// }
|
||||
return $connection->send(json_encode([
|
||||
'event' => $message['event'].':response',
|
||||
'data' => [
|
||||
|
|
@ -174,6 +160,13 @@ class Handler implements MessageComponentInterface
|
|||
} else {
|
||||
$this->addDataCheckLoop($connection, $message, $pid);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
Log::channel('websocket')->error('onMessage unhandled error: '. $e->getMessage(), [
|
||||
'file' => $e->getFile(),
|
||||
'line' => $e->getLine(),
|
||||
'trace' => $e->getTraceAsString(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue