web: cleanup sentry error catching

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-28 15:17:27 +01:00
parent 8b7f698c7b
commit db9ea8603c

View file

@ -15,7 +15,8 @@ export function configureSentry(canDoPpi: boolean = false): Promise<Config> {
Sentry.init({ Sentry.init({
dsn: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8", dsn: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8",
ignoreErrors: [ ignoreErrors: [
/network/i, /network/ig,
/fetch/ig,
], ],
release: `authentik@${VERSION}`, release: `authentik@${VERSION}`,
tunnel: "/api/v3/sentry/", tunnel: "/api/v3/sentry/",
@ -30,14 +31,6 @@ export function configureSentry(canDoPpi: boolean = false): Promise<Config> {
if (hint.originalException instanceof SentryIgnoredError) { if (hint.originalException instanceof SentryIgnoredError) {
return null; return null;
} }
if ((hint.originalException as Error | undefined)?.hasOwnProperty("name")) {
if ((hint.originalException as Error | undefined)?.name == 'NetworkError') {
return null;
}
if ((hint.originalException as Error | undefined)?.name.includes("fetch")) {
return null;
}
}
if (hint.originalException instanceof Response || hint.originalException instanceof DOMException) { if (hint.originalException instanceof Response || hint.originalException instanceof DOMException) {
return null; return null;
} }