Replaced hardcoded value in Sentry hook with config value (#7239)

* Reworked hardcoded value in Sentry hook with config value

* Fixed type checking
This commit is contained in:
Dmitry Lyzlov 2023-04-05 16:43:53 +03:00 committed by GitHub
parent 0ae3e0770d
commit d0bc2c9f7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -43,6 +43,8 @@ export function initializeSentry() {
attachStacktrace: isBetaApp, // For Beta, stack traces are automatically attached to all messages logged
};
const eventFilter = Array.isArray(Config.SentryOptions?.severityLevelFilter) ? Config.SentryOptions.severityLevelFilter : [];
Sentry.init({
dsn,
sendDefaultPii: false,
@ -58,7 +60,7 @@ export function initializeSentry() {
}),
],
beforeSend: (event: Event) => {
if (isBetaApp || event?.level === 'fatal') {
if (isBetaApp || (event?.level && eventFilter.includes(event.level))) {
return event;
}

View file

@ -18,7 +18,8 @@
"autoBreadcrumbs": {
"xhr": false,
"console": true
}
},
"severityLevelFilter": ["fatal"]
},
"ShowReview": false,