Add affected users to sentry

This commit is contained in:
Andras Bacsai 2023-09-01 11:20:58 +02:00
parent 0176b38958
commit 71e1571c39
2 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,7 @@
use App\Models\InstanceSettings; use App\Models\InstanceSettings;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Sentry\Laravel\Integration; use Sentry\Laravel\Integration;
use Sentry\State\Scope;
use Throwable; use Throwable;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
@ -48,6 +49,11 @@ public function register(): void
if ($this->settings->do_not_track || isDev()) { if ($this->settings->do_not_track || isDev()) {
return; return;
} }
app('sentry')->configureScope(
function (Scope $scope){
$scope->setUser(['id'=> config('sentry.server_name')]);
}
);
Integration::captureUnhandledException($e); Integration::captureUnhandledException($e);
}); });
} }

View File

@ -4,7 +4,7 @@
"version": "3.12.36" "version": "3.12.36"
}, },
"v4": { "v4": {
"version": "4.0.0-beta.21" "version": "4.0.0-beta.22"
} }
} }
} }