Skip to main content

Module error

Module error 

Source
Expand description

The error surface of the persistence contract.

Every store speaks StoreError from turnframe-core and nothing else, so the runtime classifies persistence failures uniformly (see turnframe_core::error::ErrorClassification). The variants and the meaning this crate attaches to them:

VariantMeaning in this contract
NotFoundThe addressed record does not exist for this account. An id that belongs to another tenant produces exactly the same error (spec §25.4).
ConflictA uniqueness rule or a compare-and-swap precondition failed: a second blocking interaction on a case, a status transition from the wrong state, a duplicate identifier, an outbox key already enqueued.
UnavailableThe backend could not be reached; nothing was written. Retryable.
TimeoutThe backend did not answer in time; the write may have landed. Callers must re-read, never blindly retry (spec §16.5).
SerializationA payload could not be encoded or decoded at the storage boundary.
CorruptStored data violates an invariant the adapter relies on (including a poisoned lock in the in-memory store).
Other { code }A refusal identified by a stable code from codes.

Display output of every variant is safe to log: identifiers and codes only.

Modules§

codes
Stable codes carried by StoreError::Other when this contract refuses a request before touching storage.

Enums§

StoreError
Errors raised by persistence adapters.

Functions§

bundle_account_mismatch
Builds the codes::BUNDLE_ACCOUNT_MISMATCH refusal.
has_code
Returns true when error is StoreError::Other with exactly code.
identity_mismatch
Builds the codes::IDENTITY_MISMATCH refusal.
invalid_record
Builds the codes::INVALID_RECORD refusal.

Type Aliases§

StoreResult
Shorthand for the result of a store operation.