pub enum PublicErrorKind {
Show 14 variants
Validation,
IdempotencyKeyReuse,
AuthorizationDenied,
ConcurrencyDeadlineExceeded,
ContractMismatch,
StorageUnavailable,
OutcomeUnknown,
InternalDefect,
CommandExecutionFailed,
HistoryIncarnationMismatch,
HistoryPruned,
Overloaded,
FollowerMode,
PrimaryFenced,
}Expand description
The closed set of failures that RiffDB may expose to an untrusted caller.
Variants§
Validation
A request failed bounded validation.
IdempotencyKeyReuse
An idempotency identity was reused with different canonical input.
AuthorizationDenied
Authorization denied the operation.
ConcurrencyDeadlineExceeded
Logical conflict acquisition exceeded its deadline, or the fixed v1 command reevaluation budget was exhausted.
ContractMismatch
The requested contract version or plan is not current.
Authoritative storage is temporarily unavailable.
OutcomeUnknown
A submitted command may have completed, but its outcome is not known.
InternalDefect
An internal defect occurred and details were retained only internally.
CommandExecutionFailed
Deterministic evaluation failed before an application commit was formed.
HistoryIncarnationMismatch
Observed history predates a database restore.
HistoryPruned
Requested history was retired by retention prune.
Overloaded
The service is over capacity and rejected admission.
FollowerMode
This node is a follower and cannot execute a write operation.
PrimaryFenced
Durable source fencing permanently refuses new command admission.
Implementations§
Source§impl PublicErrorKind
impl PublicErrorKind
Sourcepub const fn code(self) -> &'static str
pub const fn code(self) -> &'static str
Returns the stable ASCII identifier exposed by every transport.
Sourcepub const fn safe_message(self) -> &'static str
pub const fn safe_message(self) -> &'static str
Returns the stable, caller-safe ASCII message for this failure.
Sourcepub const fn class(self) -> ErrorClass
pub const fn class(self) -> ErrorClass
Returns the protocol-neutral class for this failure.
Sourcepub const fn status_code(self) -> PublicErrorStatusCode
pub const fn status_code(self) -> PublicErrorStatusCode
Returns the one authoritative public status code for this kind.
Server encoding and client validation must both use this mapping. Do not
re-derive the wire code from Self::class alone: some kinds deliberately
diverge (for example, overload keeps class ErrorClass::Unavailable while
carrying PublicErrorStatusCode::ResourceExhausted).
This match is the sole wire-code authority and must remain exhaustive over
every PublicErrorKind variant.
Sourcepub const fn recovery_action(self) -> RecoveryAction
pub const fn recovery_action(self) -> RecoveryAction
Returns safe recovery guidance for this failure.