{"record":{"id":"a12daade6caf37e4","repo":"iflytek/astron-agent","slug":"trace","errorCode":null,"errorMessage":"下载失败","messagePattern":"下载失败","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"console/frontend/src/services/trace.ts","lineNumber":95,"sourceCode":"\nexport const traceDownload = async (\n  params: { botId: string; startTime: string; endTime: string },\n  options: { signal?: AbortSignal } = {}\n) => {\n  try {\n    const response: any = await http.get(`/trace/download`, {\n      params,\n      responseType: 'blob',\n      signal: options.signal,\n      headers: {\n        Accept:\n          'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/octet-stream',\n      },\n    });\n\n    if (response?.status !== 200) {\n      // 若后端以JSON错误返回，此时 response.data 可能是Blob(JSON字符串)。\n      throw new Error(\n        (response as any)?.data?.message ||\n          (response as any)?.data?.desc ||\n          '下载失败'\n      );\n    }\n    return response;\n  } catch (error: any) {\n    // 取消请求不提示错误\n    if (error?.code === 'ERR_CANCELED' || error?.message === 'canceled') {\n      throw error;\n    }\n    throw error;\n  }\n};\n\nexport async function getWorkflowTraceExecutions(\n  flowId: string,\n  params: {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/frontend/src/services/trace.ts#L77-L113","documentation":"traceDownload throws this generic Error whenever the blob download of the trace export from GET /trace/download fails — either a non-200 HTTP status or an exception during the request. It is a catch-all that replaces the underlying network/HTTP error with a user-facing Chinese message, so the real root cause (network, auth, server error) is swallowed unless the original error is preserved.","triggerScenarios":"Thrown at console/frontend/src/services/trace.ts:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log or chain the original error (cause) before throwing so the root failure is diagnosable","Check backend availability and that /trace/download returns a file blob, not a JSON error body","Verify botId/startTime/endTime params are valid and the user is authorized","Check browser network tab for the actual HTTP status of the failed download"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}