(error)
| 121 | let billingBatchProfiles = []; |
| 122 | |
| 123 | function 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 | |
| 139 | function sleep(ms) { |
| 140 | return new Promise((resolve) => setTimeout(resolve, ms)); |
no outgoing calls
no test coverage detected