pub enum RecoveryError {
Show 13 variants
InvalidBaseUrl {
url: String,
reason: String,
},
Transport(String),
Unauthorized {
code: Option<String>,
detail: String,
},
NotEnrolled,
IdentityNotStored,
Malformed {
code: Option<String>,
detail: String,
},
AlbumKeysFull {
code: Option<String>,
detail: String,
},
Unavailable {
code: Option<String>,
detail: String,
},
Codec(String),
InvalidResponse(String),
Wrap(String),
Unexpected {
status: u16,
code: Option<String>,
},
UpgradeRequired(Box<UpgradeRequired>),
}Expand description
Everything the networked recovery flows can fail with. Callers switch on the typed
variant (or its stable error.* code), never a bare HTTP status.
Variants§
InvalidBaseUrl
The API root is not a URL the generated client can hang operation paths off.
Transport(String)
The call never reached a server answer: DNS, connection refused, a TLS handshake, a timeout, a reset mid-body, or a refusal this client could not parse. Transient — the cadence’s next tick tries again.
The generated taxonomy files a connection failure under Transport and a genuine
pre-flight one under RequestConstruction; both land here, except a session that could
not mint a bearer, which is RecoveryError::Unauthorized.
The credential was refused (401/403) and a refresh did not recover it — the user
must re-authenticate.
code is whatever the server stamped on the problem body. Today Capsule stamps one
code (error.request.unauthenticated) on every 401 it renders, so this does not yet
separate an expired token from an unreadable revocation ledger; the field carries the
code so that it will the moment the server distinguishes them.
Fields
The stable error.* catalog code from the problem body, when the failure came
with one. None when the credential could not be produced at all — there was no
server answer to carry a code.
English detail from the problem body.
NotEnrolled
The caller has no escrow stored yet (server returned a coded 404). Enroll one first.
IdentityNotStored
The caller has stored no sealed identity (GET /v1/auth/escrow/identity answered a coded
404). The escrow alone cannot open the account as itself: a device that still holds the
identity has to store it (RecoveryClient::store_sealed_identity) first.
Malformed
The server refused the blob as one that cannot be an escrow at any version — empty or
past the coarse ceiling (400), not the declared media type (415), or past the
transport’s body limit (413). Retrying the same bytes changes nothing.
Fields
AlbumKeysFull
The account’s album key escrows are at the server’s per-account bound (409, coded
error.escrow.album_keys_full): nothing was stored, and resending will not fit either.
Fields
The escrow store could not answer (500). Transient, and coded
error.escrow.unavailable — which is why it is not folded into
Transport: a caller that localizes codes has one to show.
Codec(String)
The escrow bytes could not be (de)serialized as the canonical WrappedSecret.
InvalidResponse(String)
A success answer this client could not read — a stored_at that is not an RFC 3339
instant. The server did answer 200, so the escrow may well be stored; this is the
answer being unreadable, not the write being refused.
Wrap(String)
The (re-)wrap of the master key under the fresh secret failed in core.
Unexpected
The server returned a status this client does not model as an escrow outcome — an
unmodeled status, or the body-size backstop’s 413 on a read.
Fields
UpgradeRequired(Box<UpgradeRequired>)
The server will not take this client’s writes: the protocol gate’s 426, or a window
it advertised that already refuses this build, so the write never left (issue #674).
Nothing about the escrow is wrong — update the client.
Implementations§
Source§impl RecoveryError
impl RecoveryError
Sourcepub fn error_code(&self) -> Option<&str>
pub fn error_code(&self) -> Option<&str>
The stable error.* catalog code a client localizes, when one applies. The English
Display form stays the developer/log detail.
Trait Implementations§
Source§impl Debug for RecoveryError
impl Debug for RecoveryError
Source§impl Display for RecoveryError
impl Display for RecoveryError
Source§impl Error for RecoveryError
impl Error for RecoveryError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<RecoveryError> for FfiError
impl From<RecoveryError> for FfiError
Source§fn from(err: RecoveryError) -> Self
fn from(err: RecoveryError) -> Self
Auto Trait Implementations§
impl Freeze for RecoveryError
impl RefUnwindSafe for RecoveryError
impl Send for RecoveryError
impl Sync for RecoveryError
impl Unpin for RecoveryError
impl UnsafeUnpin for RecoveryError
impl UnwindSafe for RecoveryError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more