mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 06:42:44 +00:00
fix(infra): treat undici fetch failed as transient unhandled rejection
This commit is contained in:
@@ -79,6 +79,12 @@ describe("isTransientNetworkError", () => {
|
||||
expect(isTransientNetworkError(error)).toBe(true);
|
||||
});
|
||||
|
||||
it("returns true for fetch failed with unclassified cause", () => {
|
||||
const cause = Object.assign(new Error("unknown socket state"), { code: "UNKNOWN" });
|
||||
const error = Object.assign(new TypeError("fetch failed"), { cause });
|
||||
expect(isTransientNetworkError(error)).toBe(true);
|
||||
});
|
||||
|
||||
it("returns true for nested cause chain with network error", () => {
|
||||
const innerCause = Object.assign(new Error("connection reset"), { code: "ECONNRESET" });
|
||||
const outerCause = Object.assign(new Error("wrapper"), { cause: innerCause });
|
||||
|
||||
Reference in New Issue
Block a user