mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
fix retry
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user