Struct aws_sdk_s3::error::PutObjectAclError
source · #[non_exhaustive]pub struct PutObjectAclError {
pub kind: PutObjectAclErrorKind,
/* private fields */
}
Expand description
Error type for the PutObjectAcl
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: PutObjectAclErrorKind
Kind of error that occurred.
Implementations§
source§impl PutObjectAclError
impl PutObjectAclError
sourcepub fn new(kind: PutObjectAclErrorKind, meta: Error) -> Self
pub fn new(kind: PutObjectAclErrorKind, meta: Error) -> Self
Creates a new PutObjectAclError
.
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 PutObjectAclError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 3588)
3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638
pub fn parse_put_object_acl_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::PutObjectAclOutput, crate::error::PutObjectAclError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::PutObjectAclError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::PutObjectAclError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchKey" => crate::error::PutObjectAclError {
meta: generic,
kind: crate::error::PutObjectAclErrorKind::NoSuchKey({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_key::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_key_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::PutObjectAclError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::PutObjectAclError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_put_object_acl_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::PutObjectAclOutput, crate::error::PutObjectAclError> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::put_object_acl_output::Builder::default();
let _ = response;
output = output.set_request_charged(
crate::http_serde::deser_header_put_object_acl_put_object_acl_output_request_charged(
response.headers(),
)
.map_err(|_| {
crate::error::PutObjectAclError::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 PutObjectAclError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 3614)
3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616
pub fn parse_put_object_acl_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::PutObjectAclOutput, crate::error::PutObjectAclError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::PutObjectAclError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::PutObjectAclError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchKey" => crate::error::PutObjectAclError {
meta: generic,
kind: crate::error::PutObjectAclErrorKind::NoSuchKey({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_key::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_key_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::PutObjectAclError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::PutObjectAclError::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_key(&self) -> bool
pub fn is_no_such_key(&self) -> bool
Returns true
if the error kind is PutObjectAclErrorKind::NoSuchKey
.
Trait Implementations§
source§impl Debug for PutObjectAclError
impl Debug for PutObjectAclError
source§impl Display for PutObjectAclError
impl Display for PutObjectAclError
source§impl Error for PutObjectAclError
impl Error for PutObjectAclError
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<PutObjectAclError> for Error
impl From<PutObjectAclError> for Error
source§fn from(err: PutObjectAclError) -> Self
fn from(err: PutObjectAclError) -> Self
Converts to this type from the input type.