pub enum UpgradeError {
Auth(AuthError),
Malformed {
code: Option<String>,
detail: String,
},
Unauthorized {
code: Option<String>,
detail: String,
},
NotProposer {
code: Option<String>,
detail: String,
},
NotFound {
code: Option<String>,
detail: String,
},
InFlight {
intent_id: Option<String>,
code: Option<String>,
detail: String,
},
ProtocolUnsupported {
code: Option<String>,
detail: String,
},
Unavailable {
code: Option<String>,
detail: String,
},
MalformedResponse(String),
Unexpected {
status: u16,
},
}Expand description
Everything a proposal can fail with. Callers switch on the typed variant, or on its stable
error.* code, and never on a bare status.
Every refusal carries the code the server stamped rather than one this module inferred from the status, because the ceremony’s refusals are the ones a user actually reads: “the album is already upgrading” and “your device is not an admin” are different sentences.
Variants§
Auth(AuthError)
The authenticated request itself failed (transport, session expiry, refresh).
Malformed
The server refused the body as one it cannot read as a signed intent (400), refused
the media type (415), or refused its size (413). Retrying the same bytes changes
nothing — rebuild and re-sign the intent.
Fields
The credential was refused (401).
Fields
The stable error.* catalog code the refusal carried.
English detail from the problem body.
NotProposer
The intent is not signed by a device in the caller’s published directory (403),
so the server cannot tell that an admin device really asked for this. Publish the
directory holding the proposing device first (crate::directory).
Fields
NotFound
No such album, or not this caller’s (404) — one answer for both, deliberately, so the
surface discloses nothing about albums the caller does not own.
Fields
InFlight
A different ceremony already holds this album (409), and only one may. Read the phase
(the generated GET on the same path) and either join that ceremony or wait for its
deadline; a fresh proposal replaces an expired one rather than conflicting with it.
Fields
ProtocolUnsupported
The server’s protocol gate refused the request (426): this client speaks a protocol
version outside the server’s window. Nothing about the intent is wrong — update the
client. The code is the server’s own (error.protocol.version_unsupported).
Fields
A collaborator could not answer (500). Transient.
MalformedResponse(String)
The response body was not the phase document the contract declares.
Unexpected
The server returned an unmodeled status.
Implementations§
Source§impl UpgradeError
impl UpgradeError
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 UpgradeError
impl Debug for UpgradeError
Source§impl Display for UpgradeError
impl Display for UpgradeError
Source§impl Error for UpgradeError
impl Error for UpgradeError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for UpgradeError
impl !UnwindSafe for UpgradeError
impl Freeze for UpgradeError
impl Send for UpgradeError
impl Sync for UpgradeError
impl Unpin for UpgradeError
impl UnsafeUnpin for UpgradeError
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