Struct aws_sdk_s3::error::AbortMultipartUploadError
source · #[non_exhaustive]pub struct AbortMultipartUploadError {
pub kind: AbortMultipartUploadErrorKind,
/* private fields */
}
Expand description
Error type for the AbortMultipartUpload
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: AbortMultipartUploadErrorKind
Kind of error that occurred.
Implementations§
source§impl AbortMultipartUploadError
impl AbortMultipartUploadError
sourcepub fn new(kind: AbortMultipartUploadErrorKind, meta: Error) -> Self
pub fn new(kind: AbortMultipartUploadErrorKind, meta: Error) -> Self
Creates a new AbortMultipartUploadError
.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the AbortMultipartUploadError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 13)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
pub fn parse_abort_multipart_upload_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AbortMultipartUploadOutput,
crate::error::AbortMultipartUploadError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::AbortMultipartUploadError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::AbortMultipartUploadError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchUpload" => crate::error::AbortMultipartUploadError {
meta: generic,
kind: crate::error::AbortMultipartUploadErrorKind::NoSuchUpload({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_upload::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_upload_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::AbortMultipartUploadError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::AbortMultipartUploadError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_abort_multipart_upload_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AbortMultipartUploadOutput,
crate::error::AbortMultipartUploadError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::abort_multipart_upload_output::Builder::default();
let _ = response;
output = output.set_request_charged(
crate::http_serde::deser_header_abort_multipart_upload_abort_multipart_upload_output_request_charged(response.headers())
.map_err(|_|crate::error::AbortMultipartUploadError::unhandled("Failed to parse RequestCharged from header `x-amz-request-charged"))?
);
output.build()
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the AbortMultipartUploadError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 39)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
pub fn parse_abort_multipart_upload_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AbortMultipartUploadOutput,
crate::error::AbortMultipartUploadError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::AbortMultipartUploadError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::AbortMultipartUploadError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchUpload" => crate::error::AbortMultipartUploadError {
meta: generic,
kind: crate::error::AbortMultipartUploadErrorKind::NoSuchUpload({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_upload::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_upload_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::AbortMultipartUploadError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::AbortMultipartUploadError::generic(generic),
})
}
sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_no_such_upload(&self) -> bool
pub fn is_no_such_upload(&self) -> bool
Returns true
if the error kind is AbortMultipartUploadErrorKind::NoSuchUpload
.
Trait Implementations§
source§impl Debug for AbortMultipartUploadError
impl Debug for AbortMultipartUploadError
source§impl Display for AbortMultipartUploadError
impl Display for AbortMultipartUploadError
source§impl Error for AbortMultipartUploadError
impl Error for AbortMultipartUploadError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<AbortMultipartUploadError> for Error
impl From<AbortMultipartUploadError> for Error
source§fn from(err: AbortMultipartUploadError) -> Self
fn from(err: AbortMultipartUploadError) -> Self
Converts to this type from the input type.