Skip to content

Error catalogue and diagnostics

View as Markdown

Error code casing identifies different owners. Do not normalize it:

  • generated project auth uses lowercase codes;
  • framework generated-table handlers use uppercase codes;
  • application feature contracts define and export their own codes.

Status and code are the integration contract. Message text is illustrative unless a feature explicitly pins it.

Owner/namespaceConditionStatus/codeDiagnose or recover
Generated project authNo usable credential401 unauthenticatedSign in or supply a valid bearer token
Generated project authAgent token revoked401 token_revokedReplace the credential
Generated project authAgent token expired401 token_expiredCreate a new time-bounded token
Generated project authWorkspace membership unavailable403 workspace_requiredRestore membership or select a valid workspace
Generated project authAbility or interactive-only route denied403 forbiddenReview action/subject grants and credential kind
Framework row securityRequest lacks the table’s authority slot403 row_scope_forbiddenReview the route’s authority-narrowing helper and table scope
Framework generated tableSingular row is missing or invisible404 ROW_NOT_FOUNDRecheck ID and request authority without probing other scopes
Framework generated tableManaged scope alias or write policy rejected422 VALIDATION_FAILEDRemove caller-authored scope values and inspect field details
Framework generated tableAbility passed but immutable update/delete was attempted403 FORBIDDENUse the trusted append/workflow path instead
Generated project token managementRevoke target is hidden, unknown, or already revoked404 not_foundRecheck current browser workspace, user, and token ID
App completion featureTask is missing or invisible404 TASK_NOT_FOUNDUse the feature’s exported strict error schema
App completion featureA later sequential call finds the task already completed409 TASK_ALREADY_COMPLETEDRefetch authoritative task/history state

Application feature contracts own feature responses such as strict 400/404/409 branches. Shared infrastructure 401/403 behavior lives in Auth and row security and need not be copied into every feature contract.

  • QueryParseError maps strict query failures to structured 400 responses. Unsupported filter structure uses unknown_filter_shape.
  • ValidationError and save-pipeline errors expose field or workflow validation without partial writes.
  • RowNotFoundError and ImmutableTableOperationError are server-side helper classes adapted by generated table handlers.
  • Migration readiness errors stop startup when migration files and the applied ledger disagree.
  • Native binding errors identify the addon load that failed.

An HTTP-aware app domain-error family should carry its status and strict feature payload on the base and be adapted once at the route edge. Catch that expected family exhaustively and let unexpected errors reach the central error path.

Use the smallest command that identifies the failing boundary:

Terminal window
pnpm exec sapporta endpoints show "POST /api/tasks/{id}/complete"
pnpm exec sapporta tables show tasks
pnpm exec sapporta rows get tasks 1 --output json
pnpm --filter ./packages/api db:check

Endpoint discovery proves mounting and wire shape, not authorization. Repeat security-sensitive failures through direct HTTP or CLI with the intended credential, then read back through a scoped operation.