* 包装错误
(error: Error, path: string)
| 258 | * 包装错误 |
| 259 | */ |
| 260 | private wrapError(error: Error, path: string): Error { |
| 261 | const message = `[AsterClient] Request failed for ${path}: ${error.message}`; |
| 262 | const wrappedError = new Error(message); |
| 263 | // 保存原始错误信息(兼容旧版 TypeScript) |
| 264 | (wrappedError as any).originalError = error; |
| 265 | return wrappedError; |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * 获取基础 URL |