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:
parent
0ae3e0770d
commit
d0bc2c9f7a
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@
|
|||
"autoBreadcrumbs": {
|
||||
"xhr": false,
|
||||
"console": true
|
||||
}
|
||||
},
|
||||
"severityLevelFilter": ["fatal"]
|
||||
},
|
||||
|
||||
"ShowReview": false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue