pub enum UploadError {
NotFound,
OffsetMismatch {
expected: u64,
},
Conflict {
upload_id: String,
},
TooLarge,
SizeExceeded,
TooManySessions,
Checksum {
expected: String,
actual: String,
dest_rel: String,
},
Io {
detail: String,
raw_os_error: Option<i32>,
},
}Expand description
Why an upload operation was refused.
Variants§
NotFound
No such session (unknown id, or already completed/cancelled/expired).
OffsetMismatch
The chunk did not start where the session expects.
Conflict
Another live session already targets this destination.
Carries the id of the session holding the claim. Without it a caller
that lost a transfer to a timeout is told the destination is busy and
given no way to reach the session that is busy with it — it can
neither resume that session nor cancel it, because every route to a
session is keyed by an id this refusal declined to name. A live report
had a consumer enumerating up-%016d from zero to find it, which is
both not a contract and the wrong number base (ids are hex).
TooLarge
The chunk exceeds the advertised chunk size.
SizeExceeded
This chunk would push the session past the size declared at creation.
TooManySessions
Too many sessions are already open (see MAX_CONCURRENT_UPLOADS).
Checksum
The assembled bytes do not hash to what was declared.
Fields
dest_rel: StringThe destination the rejected session was headed for. Widened for
this field for the same reason UploadStore::cancel’s return
type was: an audit event for a terminal upload outcome should be
able to name its subject. dest_rel is not consumed before this
variant is built — take_for_complete only borrows it (for
self.release(&dest_rel)) beforehand — so there was never a
reason it could not be carried here; the field was simply never
added.
Io
The filesystem refused.
Fields
detail: StringAlready-rendered detail (ToString of the underlying
io::Error). A String, not the io::Error itself: UploadError
derives Clone/PartialEq/Eq, neither of which io::Error
implements.
raw_os_error: Option<i32>The underlying io::Error’s raw_os_error(), carried alongside
detail so a caller can tell ENOSPC apart from an unrelated
failure without a locale-dependent match on the rendered message
— see platform::is_out_of_space, which upload_error_response
(src/api/fs.rs) uses this to answer.
Trait Implementations§
Source§impl Clone for UploadError
impl Clone for UploadError
Source§fn clone(&self) -> UploadError
fn clone(&self) -> UploadError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more