A sentry capture

This commit is contained in:
a6a2f5842 2025-12-02 18:51:20 +01:00
parent 6776d3c5c2
commit 7deba919b1
1 changed files with 47 additions and 34 deletions

View File

@ -75,6 +75,7 @@ class StartServer extends Command
*/
public function handle()
{
try {
$this->components->info('Handling websocket server with pid ' . getmypid() . '...');
// For is_fork() helper
@ -111,6 +112,18 @@ class StartServer extends Command
// $this->configurePongTracker();
$this->startServer();
} catch (\Throwable $e) {
$this->error('Error starting the WebSocket server: ' . $e->getMessage());
\Log::error('Error starting the WebSocket server: ', [
'exception' => $e,
]);
// if sentry is defined capture exception
if (app()->bound('sentry')) {
app('sentry')->captureException($e);
}
}
}
/**