Set Sentry level to 'warning' for captureWarning sinks

Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
Devin AI 2026-05-27 21:34:10 +00:00
parent c437e2cd70
commit 8706f61350
3 changed files with 18 additions and 3 deletions

View File

@ -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) => {

View File

@ -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) => {

View File

@ -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);
});
});
}