{"record":{"id":"f8f548a5e5781658","repo":"paperclipai/paperclip","slug":"export-failed-res-status","errorCode":null,"errorMessage":"Export failed: ${res.status}","messagePattern":"Export failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/src/api/audit.ts","lineNumber":114,"sourceCode":"\n  /**\n   * Fetch the filtered feed as a CSV blob. The server logs an `audit.exported`\n   * activity row for the export itself (training-data export precedent).\n   */\n  exportAgentActionsCsv: async (\n    companyId: string,\n    filters: Omit<AuditActionFilters, \"cursor\" | \"limit\"> = {},\n  ): Promise<Blob> => {\n    const search = buildAuditQuery(filters);\n    const qs = search.toString();\n    const res = await fetch(\n      `/api/companies/${companyId}/audit/agent-actions.csv${qs ? `?${qs}` : \"\"}`,\n      { credentials: \"include\", headers: { Accept: \"text/csv\" } },\n    );\n    if (!res.ok) {\n      const body = await res.json().catch(() => null);\n      const message = (body as { error?: string } | null)?.error ?? `Export failed: ${res.status}`;\n      throw new Error(message);\n    }\n    return res.blob();\n  },\n};\n","sourceCodeStart":96,"sourceCodeEnd":119,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/ui/src/api/audit.ts#L96-L119","documentation":"UI CSV export failure: the audit agent-actions.csv fetch returned a non-OK HTTP status. The thrown Error carries the response status so callers can distinguish auth/expiry (401) from server faults (5xx); the toast/error path should surface it and let the user retry the export.","triggerScenarios":"Thrown at ui/src/api/audit.ts:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the HTTP status; sign in again if 401/403, then retry the export.","Verify the audit export endpoint and parameters are correct, then retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}