fix retry

This commit is contained in:
discountry
2025-09-23 16:00:51 +08:00
parent ffa5b9e6fa
commit f54e81c7df
9 changed files with 164 additions and 152 deletions
+15
View File
@@ -0,0 +1,15 @@
export function isUnknownOrderError(error: unknown): boolean {
const message = extractMessage(error);
if (!message) return false;
return message.includes("Unknown order") || message.includes("code\":-2011");
}
export function extractMessage(error: unknown): string {
if (typeof error === "string") return error;
if (error instanceof Error) return error.message;
try {
return JSON.stringify(error);
} catch {
return String(error);
}
}