Skip to content

Commit 673b087

Browse files
committed
Sentry: exclude non-metaculus errors
1 parent 880c7e0 commit 673b087

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

front_end/src/sentry/options.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66

77
import {
88
beforeSentryAlertSend,
9+
SENTRY_DENY_URLS,
910
SENTRY_IGNORE_ERRORS,
1011
} from "@/utils/core/errors";
1112

@@ -27,7 +28,8 @@ export function buildSentryOptions<
2728

2829
return 0.1;
2930
},
30-
ignoreErrors: SENTRY_IGNORE_ERRORS as (string | RegExp)[],
31+
ignoreErrors: SENTRY_IGNORE_ERRORS,
32+
denyUrls: SENTRY_DENY_URLS,
3133
beforeSend: beforeSentryAlertSend,
3234
} as T;
3335
}

front_end/src/utils/core/errors.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ export const SENTRY_IGNORE_ERRORS: string[] = [
165165
"Can't find variable: logMutedMessage",
166166
];
167167

168+
export const SENTRY_DENY_URLS: (string | RegExp)[] = [
169+
/^app:\/\/\//,
170+
/extensions\//i,
171+
/^chrome:\/\//i,
172+
/^chrome-extension:\/\//i,
173+
/^moz-extension:\/\//i,
174+
];
175+
168176
export function beforeSentryAlertSend(event: ErrorEvent, hint: EventHint) {
169177
const error = hint.originalException;
170178

0 commit comments

Comments
 (0)