fix: allow fallback on timeout aborts

Co-authored-by: Larus Ivarsson <larusivar@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-20 19:23:06 +00:00
parent 4999f15688
commit 21370fc09b
3 changed files with 24 additions and 4 deletions
+3 -4
View File
@@ -33,10 +33,9 @@ function isAbortError(err: unknown): boolean {
if (!err || typeof err !== "object") return false;
if (isFailoverError(err)) return false;
const name = "name" in err ? String(err.name) : "";
if (name === "AbortError") return true;
const message =
"message" in err && typeof err.message === "string" ? err.message.toLowerCase() : "";
return message.includes("aborted");
// Only treat explicit AbortError names as user aborts.
// Message-based checks (e.g., "aborted") can mask timeouts and skip fallback.
return name === "AbortError";
}
function shouldRethrowAbort(err: unknown): boolean {