mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-26 03:01:51 +03:00
c379191f80
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
9 lines
351 B
TypeScript
9 lines
351 B
TypeScript
export function isAbortError(err: unknown): boolean {
|
|
if (!err || typeof err !== "object") 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");
|
|
}
|