mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-29 22:25:02 +00:00
fix: handle Discord gateway metadata fetch failures (#44397)
Merged via squash.
Prepared head SHA: edd17c0eff
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -130,6 +130,13 @@ describe("isTransientNetworkError", () => {
|
||||
expect(isTransientNetworkError(error)).toBe(true);
|
||||
});
|
||||
|
||||
it("returns true for wrapped Discord upstream-connect parse failures", () => {
|
||||
const error = new Error(
|
||||
`Failed to get gateway information from Discord: Unexpected token 'u', "upstream connect error or disconnect/reset before headers. reset reason: overflow" is not valid JSON`,
|
||||
);
|
||||
expect(isTransientNetworkError(error)).toBe(true);
|
||||
});
|
||||
|
||||
it("returns false for non-network fetch-failed wrappers from tools", () => {
|
||||
const error = new Error("Web fetch failed (404): Not Found");
|
||||
expect(isTransientNetworkError(error)).toBe(false);
|
||||
|
||||
@@ -61,6 +61,8 @@ const TRANSIENT_NETWORK_MESSAGE_SNIPPETS = [
|
||||
"network error",
|
||||
"network is unreachable",
|
||||
"temporary failure in name resolution",
|
||||
"upstream connect error",
|
||||
"disconnect/reset before headers",
|
||||
"tlsv1 alert",
|
||||
"ssl routines",
|
||||
"packet length too long",
|
||||
|
||||
Reference in New Issue
Block a user