mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-23 10:44:37 +00:00
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
This commit is contained in:
1 parent
37fa67f438
commit
82debf7008
1 file changed
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user