From 71e1571c39febcef9f428f7bff2d8d8707435fb7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 1 Sep 2023 11:20:58 +0200 Subject: [PATCH] Add affected users to sentry --- app/Exceptions/Handler.php | 6 ++++++ versions.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 9d9dabab6..d8cf0c9cf 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -5,6 +5,7 @@ namespace App\Exceptions; use App\Models\InstanceSettings; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Sentry\Laravel\Integration; +use Sentry\State\Scope; use Throwable; class Handler extends ExceptionHandler @@ -48,6 +49,11 @@ class Handler extends ExceptionHandler if ($this->settings->do_not_track || isDev()) { return; } + app('sentry')->configureScope( + function (Scope $scope){ + $scope->setUser(['id'=> config('sentry.server_name')]); + } + ); Integration::captureUnhandledException($e); }); } diff --git a/versions.json b/versions.json index d50394f5b..8f7d88515 100644 --- a/versions.json +++ b/versions.json @@ -4,7 +4,7 @@ "version": "3.12.36" }, "v4": { - "version": "4.0.0-beta.21" + "version": "4.0.0-beta.22" } } }