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 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.