Log warning if sendCrashReport is called while Sentry is uninitialised

This commit is contained in:
Sapphire committed 2026-12-06 05:11:09 -05:00
1 parent 23aa47fc6c
commit 64261eee6e
1 file changed
+7 -1
+7 -1
View File
@@ -185,7 +185,13 @@ export function captureServerExit(
}
export function sendCrashReport(kind: CrashReportKind) {
if (!Sentry.isInitialized()) return false;
if (!Sentry.isInitialized()) {
logger.warn(
{ kind },
'Tried to send Sentry crash report before Sentry has initialised'
);
return false;
}
const failure = lastServerFailure;
Sentry.withScope((scope) => {
scope.setTag(USER_REQUESTED_TAG, 'true');