MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / formatErrorMessage

Function formatErrorMessage

static/js/payment.js:123–137  ·  view source on GitHub ↗
(error)

Source from the content-addressed store, hash-verified

121let billingBatchProfiles = [];
122
123function formatErrorMessage(error) {
124 if (!error) return "未知错误";
125 if (typeof error === "string") return error;
126
127 // ApiClient 会把后端错误挂在 error.data 上
128 const detail = error?.data?.detail ?? error?.message;
129 if (typeof detail === "string" && detail && detail !== "[object Object]") {
130 return detail;
131 }
132 try {
133 return JSON.stringify(detail || error);
134 } catch {
135 return String(detail || error);
136 }
137}
138
139function sleep(ms) {
140 return new Promise((resolve) => setTimeout(resolve, ms));

Callers 15

runSessionDiagnosticFunction · 0.85
runSessionBootstrapFunction · 0.85
saveManualSessionTokenFunction · 0.85
randomBillingByCountryFunction · 0.85
openGptOfficialLoginFunction · 0.85
pollVendorProgressFunction · 0.85
retryVendorAutoTaskFunction · 0.85
stopVendorAutoTaskFunction · 0.85
queryEfunCardFunction · 0.85
queryEfunBillingFunction · 0.85
queryEfun3dsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected