pub enum LifecycleOpError {
Transport(String),
Refused {
status: u16,
code: String,
chain_head: Option<String>,
retention_until: Option<String>,
},
Malformed(String),
UpgradeRequired(Box<UpgradeRequired>),
}Expand description
Why a lifecycle op was not applied.
Variants§
Transport(String)
The request did not complete: the server could not be reached, the session could not authorize it, or the response was not one the contract describes.
Refused
The server refused the op with one of the problems the contract declares.
Fields
Malformed(String)
The response could not be read as the contract describes it.
UpgradeRequired(Box<UpgradeRequired>)
The server will not take this client’s writes: its 426, or a window it advertised
that already refuses this build (issue #674). Update the app.
Implementations§
Source§impl LifecycleOpError
impl LifecycleOpError
Sourcepub fn error_code(&self) -> Option<&str>
pub fn error_code(&self) -> Option<&str>
The stable error.* code the server attached to a refusal, when there is one.
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
A stable, machine-readable name for the failure — the kind a --json report carries.
retention_elapsed— atrash-restoreafter the asset’s signed retention floor (409 error.upload.retention_elapsed). The asset stays in the trash for good.stale_revival— the manifest does not chain onto the asset’s stored head (409).refused— the server judged the op itself malformed (400,413,415,422).forbidden— the caller may not write this album or asset, or is suspended (403).unauthenticated— the session was not accepted (401).upgrade_required— the server will not take this build’s writes (426).unavailable— the server could not answer (500) or could not be reached.malformed— the response could not be read.
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Whether sending the same op again can only be refused again: the server judged the op
itself (400, 409, 413, 415, 422 — a stale chain, a regressed epoch, a closed
retention window, a malformed op). An unreachable server, a session it did not accept,
a permission it did not grant, an upgrade it asked for and a server fault are not: the
same bytes may be applied once that changes.
A permanent refusal is never retried. A retention_elapsed one in particular is final
for the asset: no rebase or resend reopens a retention window.
Trait Implementations§
Source§impl Debug for LifecycleOpError
impl Debug for LifecycleOpError
Source§impl Display for LifecycleOpError
impl Display for LifecycleOpError
Source§impl Error for LifecycleOpError
impl Error for LifecycleOpError
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<AlbumError> for LifecycleOpError
impl From<AlbumError> for LifecycleOpError
Source§fn from(err: AlbumError) -> Self
fn from(err: AlbumError) -> Self
Auto Trait Implementations§
impl Freeze for LifecycleOpError
impl RefUnwindSafe for LifecycleOpError
impl Send for LifecycleOpError
impl Sync for LifecycleOpError
impl Unpin for LifecycleOpError
impl UnsafeUnpin for LifecycleOpError
impl UnwindSafe for LifecycleOpError
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