Skip to content

Commit 1f024b6

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 c9e6a7a commit 1f024b6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,15 @@
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. Match both the CDN
70+
// host and the bare filename so self-hosted/bundled Plyr is covered too.
71+
error.stack?.includes("cdn.plyr.io") ||
72+
error.stack?.includes("plyr.js");
6573

6674
if (isExternalNoise) return;
6775

0 commit comments

Comments
 (0)