Skip to content

Commit 78a1483

Browse files
committed
fix(errors): drop third-party plyr xhr noise from global error screen
Sentry wraps XMLHttpRequest and injects an app-origin stack frame, so the hostname-based external-noise filter fails to drop errors thrown from cdn.plyr.io. Treat plyr-originated errors as external noise so a network hiccup in the player never triggers the full-page error screen.
1 parent efecbb1 commit 78a1483

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

projects/client/src/lib/features/errors/ErrorProvider.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@
6161
// browser extensions as a second copy alongside Plyr's own instance.
6262
// When the iframe is torn down during SPA navigation the orphaned
6363
// API copy accesses stale registry entries; not actionable for us.
64-
error.stack?.includes("www-widgetapi.js");
64+
error.stack?.includes("www-widgetapi.js") ||
65+
// Plyr's own scripts throw from an XHR error listener on network-layer
66+
// failures (e.g. Error: 0). Sentry wraps XMLHttpRequest and injects an
67+
// app-origin frame, so the hostname check above lets these through even
68+
// though the originating frame is third-party. A cosmetic player hiccup
69+
// must not escalate to the full-page error screen.
70+
error.stack?.includes("cdn.plyr.io");
6571

6672
if (isExternalNoise) return;
6773

0 commit comments

Comments
 (0)