iflytek/astron-agent · error · Error
下载失败
Error message
下载失败
What it means
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.
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at console/frontend/src/services/trace.ts:95 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/a12daade6caf37e4.
Report an issue: GitHub.
Appendix: source
Thrown at console/frontend/src/services/trace.ts:95
export const traceDownload = async (
params: { botId: string; startTime: string; endTime: string },
options: { signal?: AbortSignal } = {}
) => {
try {
const response: any = await http.get(`/trace/download`, {
params,
responseType: 'blob',
signal: options.signal,
headers: {
Accept:
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, application/octet-stream',
},
});
if (response?.status !== 200) {
// 若后端以JSON错误返回,此时 response.data 可能是Blob(JSON字符串)。
throw new Error(
(response as any)?.data?.message ||
(response as any)?.data?.desc ||
'下载失败'
);
}
return response;
} catch (error: any) {
// 取消请求不提示错误
if (error?.code === 'ERR_CANCELED' || error?.message === 'canceled') {
throw error;
}
throw error;
}
};
export async function getWorkflowTraceExecutions(
flowId: string,
params: {View on GitHub (pinned to 5e758547a8)