From 82debf700818bf36dbb9c972cf233005707ef7e3 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 12 Nov 2026 17:08:36 +0000 Subject: [PATCH] enhance: ignore AbortError in the global error handler (#40335) Aborted requests are nothing users can act on, so the global error handler now ignores `AbortError` like it already ignores network errors. Browsers can abort in-flight requests on navigation or download clicks, which showed a "JavaScript promise rejection" banner. Assisted-by: Claude Code:claude-opus-5-5 --- web_src/js/modules/errors.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/js/modules/errors.ts b/web_src/js/modules/errors.ts index 22c0e693ff3..67740f21fa9 100644 --- a/web_src/js/modules/errors.ts +++ b/web_src/js/modules/errors.ts @@ -74,9 +74,9 @@ export function processWindowErrorEvent({error, reason, message, type, filename, if (windowConfig()?.runModeIsProd) return; } - // Don't show network errors, happens on ref-issue when clicking on the + // Don't show network errors and aborts, happens on ref-issue when clicking on the // issue link while the fetch request is still running. - if (isNetworkError(err)) return; + if (isNetworkError(err) || errorName(err) === 'AbortError') return; // Filter out errors from browser extensions or other non-Gitea scripts. if (!isGiteaError(filename ?? '', err?.stack ?? '')) return;