pub enum UploadError {
Io(Error),
Transport(String),
Rejected {
status: u16,
code: Option<String>,
message: String,
},
UpgradeRequired {
reason: UpgradeReason,
min: Option<String>,
max: Option<String>,
min_client_build: Option<String>,
message: String,
},
RetriesExhausted(String),
WaitsExhausted {
status: u16,
code: Option<String>,
message: String,
reason: String,
},
MalformedResponse(String),
Auth(AuthError),
SourceChanged(SourceChanged),
}Expand description
Upload client errors.
Variants§
Io(Error)
IO error over the local byte source.
Transport(String)
Network / transport failure (connection, timeout, body read).
Rejected
A typed server rejection carrying its stable error.* code and status.
Non-recoverable at this layer — surfaced to the caller.
A finalization the server refused is reported the same way, with the code HEAD carried
in X-Capsule-Upload-Error (content_hash_mismatch, envelope_rejected,
replace_incomplete, stale_revival, …) and the 200 of the HEAD that read it: no
request waits on finalization, so its refusal is read, never answered. A caller switches
on the code, as it always has.
Fields
UpgradeRequired
The server will not take this client’s uploads: it answered 426 Upgrade Required, or
the window it advertised already refuses this build, so the request never left. The
SDK’s one UpgradeRequired, flattened:
carries the advertised window so the UI can show an actionable “update Capsule to keep
uploading” message. Abort-with-upgrade.
Fields
reason: UpgradeReasonWhich rule refused.
RetriesExhausted(String)
A recovery action (re-align / re-create / re-send) exceeded its bounded budget — the peer is stuck; fail loudly rather than hot-loop.
WaitsExhausted
The server kept answering with a retryable status (any 5xx, 408, 425, 429, or
a wait code) and the transfer gave up waiting it out once its recovery budget, the
lane’s shared retry budget or the retry engine’s backoff was spent; or it was still
finalizing the session when the finalization poll’s deadline passed. Carries the last
answer’s status and stable error.* code, so a caller still localizes what the server
said. Transient: a later run may find the server recovered.
Fields
MalformedResponse(String)
A server response was missing a required header or otherwise unparsable.
Auth(AuthError)
The session’s auth layer failed (not authenticated, refresh rejected, session expired). Carries the typed session error so callers can trigger interactive re-authentication.
SourceChanged(SourceChanged)
The source the blob is read from no longer matches what its bundle was built from, so
nothing more of it is sent: a re-derived range would put different bytes under the
nonces the first derivation spent. The session is cancelled; the asset is pushed again
once its bundle is rebuilt. Its code is error.upload.source_changed, which the client
mints itself: no server answer carries it.
Implementations§
Source§impl UploadError
impl UploadError
Sourcepub fn error_code(&self) -> Option<&str>
pub fn error_code(&self) -> Option<&str>
The stable error.* code of the answer this error reports: a refusal’s, or the last
answer of a wait the transfer gave up on; for a changed source, the client’s own
error.upload.source_changed.
Trait Implementations§
Source§impl Debug for UploadError
impl Debug for UploadError
Source§impl Display for UploadError
impl Display for UploadError
Source§impl Error for UploadError
impl Error for UploadError
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<AuthError> for UploadError
impl From<AuthError> for UploadError
Source§impl From<Error> for UploadError
impl From<Error> for UploadError
Source§impl From<Error> for UploadError
impl From<Error> for UploadError
Source§impl From<SourceChanged> for UploadError
impl From<SourceChanged> for UploadError
Source§fn from(source: SourceChanged) -> Self
fn from(source: SourceChanged) -> Self
Source§impl From<UpgradeRequired> for UploadError
impl From<UpgradeRequired> for UploadError
Source§fn from(refusal: UpgradeRequired) -> Self
fn from(refusal: UpgradeRequired) -> Self
Source§impl From<UploadError> for DelegationError
impl From<UploadError> for DelegationError
Source§fn from(source: UploadError) -> Self
fn from(source: UploadError) -> Self
Source§impl From<UploadError> for PushError
impl From<UploadError> for PushError
Source§fn from(source: UploadError) -> Self
fn from(source: UploadError) -> Self
Source§impl From<UploadError> for StagedError
impl From<UploadError> for StagedError
Source§fn from(source: UploadError) -> Self
fn from(source: UploadError) -> Self
Source§impl From<UploadError> for FfiError
impl From<UploadError> for FfiError
Source§fn from(err: UploadError) -> Self
fn from(err: UploadError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for UploadError
impl !UnwindSafe for UploadError
impl Freeze for UploadError
impl Send for UploadError
impl Sync for UploadError
impl Unpin for UploadError
impl UnsafeUnpin for UploadError
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