paperclipai/paperclip · error

Export failed: ${res.status}

Error message

Export failed: ${res.status}

What it means

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.

Source

Thrown at ui/src/api/audit.ts:114

  /**
   * Fetch the filtered feed as a CSV blob. The server logs an `audit.exported`
   * activity row for the export itself (training-data export precedent).
   */
  exportAgentActionsCsv: async (
    companyId: string,
    filters: Omit<AuditActionFilters, "cursor" | "limit"> = {},
  ): Promise<Blob> => {
    const search = buildAuditQuery(filters);
    const qs = search.toString();
    const res = await fetch(
      `/api/companies/${companyId}/audit/agent-actions.csv${qs ? `?${qs}` : ""}`,
      { credentials: "include", headers: { Accept: "text/csv" } },
    );
    if (!res.ok) {
      const body = await res.json().catch(() => null);
      const message = (body as { error?: string } | null)?.error ?? `Export failed: ${res.status}`;
      throw new Error(message);
    }
    return res.blob();
  },
};

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Check the HTTP status; sign in again if 401/403, then retry the export.
  2. Verify the audit export endpoint and parameters are correct, then retry.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at ui/src/api/audit.ts:114 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/f8f548a5e5781658. Report an issue: GitHub.