diff --git a/backend/app/Telegram/WebhookController.php b/backend/app/Telegram/WebhookController.php index b48587b..2495908 100644 --- a/backend/app/Telegram/WebhookController.php +++ b/backend/app/Telegram/WebhookController.php @@ -30,7 +30,7 @@ class WebhookController extends if($this->user) return $this->user; try { $this->user = $this->message->from()->storage()->get('user', null); - } catch (\Exception $e) { + } catch (\Exception|\Throwable|\Error $e) { $this->user = null; } diff --git a/backend/config/sentry.php b/backend/config/sentry.php index 6476e31..8038882 100644 --- a/backend/config/sentry.php +++ b/backend/config/sentry.php @@ -56,6 +56,14 @@ return [ 'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true), ], + 'before_send' => function (\Sentry\Event $event, ?\Sentry\EventHint $hint): ?\Sentry\Event { + if ($hint !== null && $hint->exception instanceof JsonException) { + return null; + } + + return $event; + }, + // Performance monitoring specific configuration 'tracing' => [ // Trace queue jobs as their own transactions (this enables tracing for queue jobs)