Raw 'C2 API error 403: {"detail":...}' shown to users across most screens #286

Closed
opened 2026-10-25 21:32:13 -04:00 by logan · 0 comments
Owner

Found in a UX pass 2026-10-25. Searched open+closed: no duplicate (only lib/discord.ts has a parser).

request() throws new Error("C2 API error ${status}: ${body}") (lib/c2api.ts:22), where body is the raw JSON {"detail":"..."}. Most surfaces print it unparsed: String(e) gives "Error: C2 API error 403: {...}" (e.g. app/calls/page.tsx:111,123,269, app/systems/page.tsx:1503,1520,1635,1653, app/admin/page.tsx:113,125,183,...), and alert(err.message) on app/nodes/page.tsx:45, app/nodes/[id]/page.tsx:86,97,110,121, plus members/nodes settings and onboarding/waitlist. Only the Discord screens use parseC2Error (lib/discord.ts).

Fix: move the parse into request() (expose .status and a human .message from detail), map 401/403/5xx to plain sentences, then the call sites need no change.

Found in a UX pass 2026-10-25. Searched open+closed: no duplicate (only `lib/discord.ts` has a parser). `request()` throws `new Error("C2 API error ${status}: ${body}")` (`lib/c2api.ts:22`), where body is the raw JSON `{"detail":"..."}`. Most surfaces print it unparsed: `String(e)` gives "Error: C2 API error 403: {...}" (e.g. `app/calls/page.tsx:111,123,269`, `app/systems/page.tsx:1503,1520,1635,1653`, `app/admin/page.tsx:113,125,183,...`), and `alert(err.message)` on `app/nodes/page.tsx:45`, `app/nodes/[id]/page.tsx:86,97,110,121`, plus members/nodes settings and onboarding/waitlist. Only the Discord screens use `parseC2Error` (`lib/discord.ts`). Fix: move the parse into `request()` (expose `.status` and a human `.message` from `detail`), map 401/403/5xx to plain sentences, then the call sites need no change.
logan added the
type
bug
area/frontend
priority
p2
labels 2026-10-25 21:32:13 -04:00
logan closed this issue 2026-10-25 21:39:16 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: logan/server-26#286