Skip to main content
Every method throws a NaiveError on a non-2xx response:

Common codes

Pending approval is not an error

A sensitive call gated by the user’s AccountKit returns HTTP 202 with { status: "pending_approval", approval_id }. This is a success-with-deferral — it does not throw. The gated methods (cards.create, domains.purchase, verification.start, formation.submit, connections.connect, …) resolve to either their normal result or a PendingApproval. Discriminate with the typed helper:
asDecision(res) folds the same thing into a tagged union when you would rather branch on res.decision than call a predicate. See Governance for the full allow / park / deny model.

NotImplementedError — a route this control plane does not mount

Eight methods on the durable-runtime handles have no mounted route. They do not return {} and they do not guess at a path: each throws NotImplementedError naming the exact METHOD /path it would have called, and sends nothing.
NotImplementedError means the route does not exist — not that it is unfinished. A route that IS mounted but has no backing store answers 501 not_configured and arrives as an ordinary NaiveError with details.missing listing what the server is waiting on. The client never pre-empts that: it is more specific than anything this package could guess, and it stops being returned the day the dependency lands. If you want to treat “not built yet” as one case, match on both:
NotImplementedError extends NaiveError, so a generic catch (err) { if (err instanceof NaiveError) … } still handles it — check for the subclass first if you want to treat “no such route” differently from “the server said no”. See Teams & the durable runtime for the full wired-vs-refuses table.

The closed code union

NaiveError.code stays typed string so existing comparisons keep compiling. The closed union of all 36 codes ships alongside as NaiveErrorCode, with isNaiveErrorCode() to narrow and denialOf(err) to pull out a structured denial. See Governance → the denial vocabulary. See Approvals.