MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / formatErrorForDisplay

Function formatErrorForDisplay

ai/ai.ts:587–600  ·  view source on GitHub ↗
(error: any)

Source from the content-addressed store, hash-verified

585
586const 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
601const sendProcessing = async (
602 msg: Api.Message,
603 kind: ProcessingKind,

Callers 1

sendErrorMessageFunction · 0.85

Calls 1

extractErrorMessageFunction · 0.70

Tested by

no test coverage detected