mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Set Sentry level to 'warning' for captureWarning sinks
Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
parent
c437e2cd70
commit
8706f61350
@ -32,7 +32,12 @@ export function ensurePolyfilled() {
|
||||
}
|
||||
|
||||
registerErrorSink(sentryErrorSink);
|
||||
registerWarningSink(sentryErrorSink);
|
||||
registerWarningSink((location, error) => {
|
||||
Sentry.withScope((scope) => {
|
||||
scope.setLevel("warning");
|
||||
sentryErrorSink(location, error);
|
||||
});
|
||||
});
|
||||
|
||||
if ("addEventListener" in globalThis) {
|
||||
globalThis.addEventListener("unhandledrejection", (event) => {
|
||||
|
||||
@ -25,7 +25,12 @@ export function ensurePolyfilled() {
|
||||
}
|
||||
|
||||
registerErrorSink(sentryErrorSink);
|
||||
registerWarningSink(sentryErrorSink);
|
||||
registerWarningSink((location, error) => {
|
||||
Sentry.withScope((scope) => {
|
||||
scope.setLevel("warning");
|
||||
sentryErrorSink(location, error);
|
||||
});
|
||||
});
|
||||
|
||||
if ("addEventListener" in globalThis) {
|
||||
globalThis.addEventListener("unhandledrejection", (event) => {
|
||||
|
||||
@ -94,5 +94,10 @@ export function initSentry() {
|
||||
ignoreUnhandledRejection(Sentry.flush(2000));
|
||||
};
|
||||
registerErrorSink(sentrySink);
|
||||
registerWarningSink(sentrySink);
|
||||
registerWarningSink((location, error) => {
|
||||
Sentry.withScope((scope) => {
|
||||
scope.setLevel("warning");
|
||||
sentrySink(location, error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user