From 6f1c143eb4a1eae3424b16f30f455627810e7545 Mon Sep 17 00:00:00 2001 From: "posthog[bot]" <206114724+posthog[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 15:11:07 +0000 Subject: [PATCH] fix(browser): downgrade non-Error unhandled rejections to warnings A rejected promise whose reason isn't an Error carries no stack and no meaningful type. In practice these are almost always injected third-party scripts (email/link scanners, browser extensions) rejecting a plain value, not real app faults. Reporting them at the default `error` severity opens a first-class issue for pure noise. Report them as `warning` instead: still captured and visible for debugging, but they no longer sit alongside real errors, and `beforeSend` can drop them entirely. Error-typed rejections are unchanged. Generated-By: PostHog Code Task-Id: d67e689e-e9cc-4d3d-8166-36e2e3333894 --- packages/runtime-browser/src/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/runtime-browser/src/index.ts b/packages/runtime-browser/src/index.ts index d77d70e..a73d060 100644 --- a/packages/runtime-browser/src/index.ts +++ b/packages/runtime-browser/src/index.ts @@ -276,6 +276,14 @@ export function initAutterBrowser(options: AutterBrowserOptions): void { if (isError) { e.errorType = reason.name; if (reason.stack) e.stack = String(reason.stack).slice(0, 32000); + } else { + // A rejection whose reason isn't an Error carries no stack and no + // meaningful type. In practice most are injected third-party + // scripts (email/link scanners, browser extensions) rejecting a + // plain value, not a real app fault — so report it as a warning + // rather than a first-class error/issue. Still visible for + // debugging; `beforeSend` can drop it entirely. + e.severity = "warning"; } enqueue(e, true); },