#[non_exhaustive]pub enum ErrorKind {
InputInvalid,
IOError,
RuntimeError,
ObjectNotDiscoverable,
ServiceError,
IntegrityError(IntegrityError),
ChildOperationFailed,
OperationCancelled,
}Expand description
General categories of transfer errors.
The kind classifies where a failure arose. It does not say whether resubmitting the operation can succeed: failures the transfer manager can repair, such as throttling responses and interrupted body reads, are retried internally before an error of any kind is returned.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InputInvalid
The operation’s input was rejected: a required field is missing, a value is out of range, settings conflict, or the source cannot be transferred as requested, such as a stream that produces more parts than a multipart upload allows or an object key that resolves outside the download destination or to the destination itself. Conditions visible in the input are reported before any request is sent; conditions that depend on the source data are reported when the transfer encounters them.
IOError
An I/O operation failed. This covers both local filesystem failures (opening, reading, writing, or renaming a file) and transport failures while reading an object body from S3, such as a reset connection or a truncated response. The source error identifies which.
Because the kind spans local and remote failures, it does not indicate
whether resubmitting the operation can succeed. When a body read fails
for a specific chunk, Error::chunk identifies it.
RuntimeError
The transfer manager could not continue for an internal reason that is not an input, I/O or service failure.
ObjectNotDiscoverable
Object discovery failed for a reason that is not a service-call error, such as a response missing required metadata.
ServiceError
A request to S3 failed, or S3 answered with a response the transfer
cannot use, such as an UploadPart response without an ETag or a ranged
GetObject or HeadObject response whose Content-Range doesn’t match the
requested range. The
originating operation, service error code (when S3 reported one),
message, and request ids are available via the accessors on Error
(Error::operation_name, Error::code, Error::request_id).
Service-specific outcomes are identified by their code rather than by a
kind of their own. A conditional write whose precondition did not hold
(if_match / if_none_match on an upload) arrives here with
Error::code of "PreconditionFailed"; S3 reports that code in the
response body, so it is available whatever HTTP status carries it.
A whole-object download with checksum validation enabled, or a download of an
open-ended or suffix range, discovers the object with HeadObject. S3 answers a
failed HeadObject without a body, so the error carries the HTTP status and
request ids but no message, and a code only where the status identifies one:
"PreconditionFailed" for 412, "NotModified" for 304, "InvalidRange" for
416, and the SDK’s "NotFound" for 404. A missing key is "NotFound", not
"NoSuchKey" as a failed GetObject reports.
IntegrityError(IntegrityError)
Object integrity validation failed: the received bytes did not match the
expected checksum. See the wrapped IntegrityError for detail.
ChildOperationFailed
A child of a bulk transfer (upload_objects / download_objects) failed.
The individual failures are available via Error::failed_uploads /
Error::failed_downloads.
The error’s source is the error of the
first failed object. Under
FailedTransferPolicy::Abort
that is the failure that stopped the transfer.
OperationCancelled
The operation was cancelled, either because the user called .abort() on the
handle, or a child operation failed under the abort policy.
Trait Implementations§
impl Eq for ErrorKind
impl StructuralPartialEq for ErrorKind
Auto Trait Implementations§
impl Forget for ErrorKind
impl Freeze for ErrorKind
impl Move for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnsafeUnpin for ErrorKind
impl UnwindSafe for ErrorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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