Expand description
AxError, the one error shape of the whole city, and
AxCode, the closed set of 35 error codes.
The part crates/kernel/spec/Error.lean specifies this module.
Invariants owned here:
- every wire spelling (
E_…) has exactly one authority:AxCode::as_str; serde delegates to it in both directions, so enum and wire cannot drift. - a gate refusal always carries the three mandatory parts (rule,
violation, alternative):
AxError::refusalis the only path that sets them andAxError::failurecannot. - every constructed error says what to do next: both constructors
return an
ErrorDraft, andErrorDraft::with_recoveryis the only way to obtain anAxError. retrydefaults toRetry::No; a caller must opt in explicitly (fail-closed).accountisAccountDisposition::Advanceonly besideRetry::Nowith no wait:ErrorDraft::account_unusableis the only path that sets it, and every other retry builder puts it back toKeep.
The carrier-event declaration (AxCode::carrier) lives together with
kernel::event because it names EventKind.
Structs§
- AxError
- The unified error shape: seven wire fields and two that are left out
when absent, serialized in declaration order (determinism rule 6).
The model is the recovery subject:
nearbyandrecoverymust hold directly executable information, not apologies. - Error
Draft - An error that still owes the reader its recovery sentence.
- Gate
Refusal - The three mandatory parts of a gate refusal: rule | violation | compliant alternative (three-part refusal).
Enums§
- Account
Disposition - Whether the account a request went out on can still take it
(
crates/kernel/spec/Error.leanD53). - AxCode
- Closed set of error codes.
Extension is additive only; the wire spelling lives in
AxCode::as_str. - Carrier
- Where an AxCode surfaces in history: its carrier event, or the loadtime class (the closed C9 exception: the Ledger is not writable yet).
- Provider
Failure Kind - The kind of one provider failure, as the call site that saw it named it. It travels on the wire so a page can say it in the reader’s own language; the city’s recovery sentence stays beside it for the fold.
- Retry
- Whether the same request may go out again, said together with
whether its effect already landed. On the wire
"yes","no"or"unknown"; a ledger record written asretriable: true/falsereads asYes/No.