pub enum FetchError {
Gone,
AuthorizationChanged {
code: Option<String>,
},
PendingUpload,
Transient(String),
Rejected {
status: u16,
code: Option<String>,
},
IntegrityFailed {
expected: String,
},
Unauthenticated {
code: Option<String>,
message: String,
},
Exhausted(String),
TooLarge {
limit: u64,
},
Sink(Error),
Corrupt {
hash: String,
},
}Expand description
Why a representation could not be fetched. The variants drive the degrade
ladder: FetchError::Gone is permanent, FetchError::AuthorizationChanged
triggers a membership re-sync, FetchError::PendingUpload is the transient
awaiting-original state, and the rest are transient/structural.
Variants§
Gone
410 Gone / 404 / purged origin — permanently unavailable; degrade.
AuthorizationChanged
403 — an authorization change, not a durability loss. Re-sync membership
then retry; only then degrade (the asset may have been unshared).
Carries the stable code, because the 403s on this route no longer say one thing: an
account’s error.blob.access_revoked means re-sync membership, while a federated
peer’s error.federation.scope_insufficient means the grant never covered this blob and
re-syncing anything will not change that. A caller that could not tell them apart would
retry the second forever.
PendingUpload
error.blob.pending_upload — the original has not landed yet
(awaiting-original); show the badge, never a failure, and re-fetch when
the feed flips original_held. Explicitly distinct from 410 Gone.
Transient(String)
A transient failure (network drop, 5xx): retry with backoff and resume.
Rejected
A structural server rejection the client does not model.
IntegrityFailed
The reassembled ciphertext did not hash to the requested content address — the blob is discarded.
Unauthenticated
The session could not authorize the fetch — a refused refresh, no tokens, or a 401
that survived the session’s one refresh-and-retry. Not transient: the caller signs in
again rather than retrying.
Fields
Exhausted(String)
The bounded resume budget was spent without completing the transfer.
TooLarge
A blob fetched without a known size (RangedFetcher::fetch_unsized) kept going past
the caller’s limit; the bytes held are discarded rather than grown without bound.
Sink(Error)
The destination of a streamed fetch (RangedFetcher::fetch_into) refused bytes: a
local write failed, or a decrypting sink rejected a chunk. Whatever the sink holds is
unverified and must be discarded. For RangedFetcher::fetch_to_file it is a failure
reading, writing, syncing or renaming the partial file; the partial is kept, unverified,
for the next attempt to resume and verify. A failure to sync the destination’s directory
after the rename is logged, not returned here.
Corrupt
A derivative’s ciphertext hashed correctly but failed AEAD authentication under the key its manifest selects — a corrupt blob, discarded.
Implementations§
Source§impl FetchError
impl FetchError
Sourcepub fn error_code(&self) -> Option<&str>
pub fn error_code(&self) -> Option<&str>
The stable error.* catalog code, when one applies.
Sourcepub fn is_permanent(&self) -> bool
pub fn is_permanent(&self) -> bool
Whether the failure is permanent (degrade) rather than retryable.
Trait Implementations§
Source§impl Debug for FetchError
impl Debug for FetchError
Source§impl Display for FetchError
impl Display for FetchError
Source§impl Error for FetchError
impl Error for FetchError
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<FetchError> for FfiError
impl From<FetchError> for FfiError
Source§fn from(err: FetchError) -> Self
fn from(err: FetchError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for FetchError
impl !UnwindSafe for FetchError
impl Freeze for FetchError
impl Send for FetchError
impl Sync for FetchError
impl Unpin for FetchError
impl UnsafeUnpin for FetchError
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