Skip to content

Error Codes

StemJSON uses a structured error code system for repository and service failures. Error codes are accessible in action failure chains via @{actionId.code}.

CategoryCodeDescription
GeneralunknownUnclassified error.
GeneralcancelledOperation was cancelled.
GeneraltimeoutOperation timed out.
GeneraldecodingFailedResponse could not be decoded.
GeneralencodingFailedRequest body could not be encoded.
GeneralmissingDataExpected data was absent in the response.
GeneraldependencyNotRegisteredA referenced dependency id was not found in the registry.
NetworkinvalidResponseServer returned an unrecognizable response.
NetworknoConnectionNo network connectivity.
NetworkinvalidURLThe endpoint URL is malformed.
NetworkbadRequestHTTP 400 — request was rejected by the server.
NetworknotAuthenticatedHTTP 401 — authentication required.
NetworknotAuthorizedHTTP 403 — access denied.
NetworknotFoundHTTP 404 — resource not found.
NetworkconflictHTTP 409 — resource conflict.
NetworkinternalServerHTTP 500 — server-side error.
NetworkserviceUnavailableHTTP 503 — server temporarily unavailable.
StoragedocumentExistsDocument already exists (local repo).
StoragedocumentNotFoundDocument not found (local repo).
StoragenoDocumentIdOperation requires a document id but none was provided.
StoragesavingFailedCould not persist the document.
StoragedeletionFailedCould not delete the document.
SecuritykeychainAccessKeychain access error (secured repo).
SecurityitemNotFoundKey not found in keychain.
SecurityuserCanceledAuthUser canceled biometric / passcode authentication.
SecurityenclaveLockedSecure enclave is locked.

Validators emit human-readable log records during payload validation and schema checks. Each record MUST include a classified, actionable message — a generic placeholder (e.g. "Unexpected error") in a public log record is non-conforming.

Record fields (normative):

FieldRequiredDescription
severityREQUIREDOne of: bingo, info, note, warning, error, critical (see §17).
contextREQUIREDA path-like breadcrumb identifying where the issue occurred (e.g. component id: 'feed_list' → general → ...).
publicMessageREQUIREDShort, author-facing message. MUST name the error category (type mismatch, missing key, expression parse error, invalid source URL, …) and, where available, the offending value or token. MUST NOT contain file paths, URLs, or OS-internal identifiers.
privateDetailsOptionalAdditional diagnostic text that MAY contain paths or low-level descriptions. Implementations MAY surface this only in development builds.

Category coverage (normative):

Implementations MUST produce classified public messages for at least the following error classes thrown during validation:

  • Schema decoding failures — missing required keys, type mismatches, invalid enum values, malformed source strings.
  • Expression parse failures — unexpected tokens, missing operators, excessive nesting.
  • Package structure failures (for zip-packaged modules) — missing main.json, multiple main.json at the archive root, corrupt archive.
  • Dependency resolution failures — unknown repository / service id, cyclic dependency.

Implementations SHOULD additionally emit warning-severity records for the following authoring pitfalls — they do not block rendering but produce broken or unintuitive UI:

  • Out-of-domain initial state value. Any initial state literal that is statically provably outside the valid domain of the input component bound to it (§11.1). The check generalises across all bound input components — sliders, pickers, toggles, datepickers, and any future component that declares a domain.
  • Source string missing scheme prefix. Any value supplied to a source-accepting field (_source, _image, _placeholder, etc.) that lacks a <scheme>:// prefix, with the documented _tabImage exception (§6.4). The check generalises across all current and future schemes.
  • Ambiguous string value form. Any string value at a value-accepting field that mixes literal text and reference markers without {{ }} wrapping, i.e. that does not match exactly one of: literal / single bare reference / {{ … }} expression (§6.2).

Unclassified failure paths SHOULD be tracked and fixed at their source rather than handled in a generic fallback.