mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:28:26 +00:00
fix(infra): treat undici fetch failed as transient unhandled rejection
This commit is contained in:
@@ -94,12 +94,10 @@ export function isTransientNetworkError(err: unknown): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
// "fetch failed" TypeError from undici (Node's native fetch)
|
||||
// "fetch failed" TypeError from undici (Node's native fetch).
|
||||
// Treat as transient regardless of nested cause code because causes vary
|
||||
// across runtimes and can be unclassified even for real network faults.
|
||||
if (err instanceof TypeError && err.message === "fetch failed") {
|
||||
const cause = getErrorCause(err);
|
||||
if (cause) {
|
||||
return isTransientNetworkError(cause);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user