(error: any)
| 585 | |
| 586 | const formatErrorForDisplay = (error: any): string => { |
| 587 | if ( |
| 588 | error instanceof UserError || |
| 589 | error?.name === "AbortError" || |
| 590 | (typeof error?.message === "string" && |
| 591 | error.message.toLowerCase().includes("aborted")) |
| 592 | ) { |
| 593 | const extracted = extractErrorMessage(error); |
| 594 | if (extracted === "请求超时") return `❌ <b>错误:</b> 请求超时`; |
| 595 | const msg = error instanceof UserError ? error.message : "操作已取消"; |
| 596 | return `🚫 ${msg}`; |
| 597 | } |
| 598 | return `❌ <b>错误:</b> ${extractErrorMessage(error)}`; |
| 599 | }; |
| 600 | |
| 601 | const sendProcessing = async ( |
| 602 | msg: Api.Message, |
| 603 | kind: ProcessingKind, |
no test coverage detected