Struct aws_sdk_cloudfront::error::UpdateKeyGroupError
source · #[non_exhaustive]pub struct UpdateKeyGroupError {
pub kind: UpdateKeyGroupErrorKind,
/* private fields */
}
Expand description
Error type for the UpdateKeyGroup
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: UpdateKeyGroupErrorKind
Kind of error that occurred.
Implementations§
source§impl UpdateKeyGroupError
impl UpdateKeyGroupError
sourcepub fn new(kind: UpdateKeyGroupErrorKind, meta: Error) -> Self
pub fn new(kind: UpdateKeyGroupErrorKind, meta: Error) -> Self
Creates a new UpdateKeyGroupError
.
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 UpdateKeyGroupError::Unhandled
variant from any error type.
Examples found in repository?
12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560 12561 12562 12563 12564 12565 12566 12567 12568 12569 12570 12571 12572 12573 12574 12575 12576 12577 12578 12579 12580 12581 12582 12583 12584 12585 12586 12587
pub fn parse_update_key_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateKeyGroupOutput, crate::error::UpdateKeyGroupError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateKeyGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateKeyGroupError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidArgument" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::InvalidArgument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIfMatchVersion" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::InvalidIfMatchVersion({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_if_match_version::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_if_match_version_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KeyGroupAlreadyExists" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::KeyGroupAlreadyExists({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::key_group_already_exists::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_key_group_already_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchResource" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::NoSuchResource({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_resource::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_no_such_resource_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"PreconditionFailed" => {
crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::PreconditionFailed({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::precondition_failed::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_precondition_failed_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"TooManyPublicKeysInKeyGroup" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::TooManyPublicKeysInKeyGroup({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::too_many_public_keys_in_key_group::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_public_keys_in_key_group_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateKeyGroupError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_key_group_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateKeyGroupOutput, crate::error::UpdateKeyGroupError> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::update_key_group_output::Builder::default();
let _ = response;
output = output.set_e_tag(
crate::http_serde::deser_header_update_key_group_update_key_group_output_e_tag(
response.headers(),
)
.map_err(|_| {
crate::error::UpdateKeyGroupError::unhandled(
"Failed to parse ETag from header `ETag",
)
})?,
);
output = output.set_key_group(
crate::http_serde::deser_payload_update_key_group_update_key_group_output_key_group(
response.body().as_ref(),
)?,
);
output.build()
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateKeyGroupError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
12431 12432 12433 12434 12435 12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 12448 12449 12450 12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 12461 12462 12463 12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 12476 12477 12478 12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 12490 12491 12492 12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 12506 12507 12508 12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 12519 12520 12521 12522 12523 12524 12525 12526 12527 12528 12529 12530 12531 12532 12533 12534 12535 12536 12537 12538 12539 12540 12541 12542 12543 12544 12545 12546 12547 12548 12549 12550 12551 12552 12553 12554 12555 12556 12557 12558 12559 12560
pub fn parse_update_key_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateKeyGroupOutput, crate::error::UpdateKeyGroupError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateKeyGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateKeyGroupError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidArgument" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::InvalidArgument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIfMatchVersion" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::InvalidIfMatchVersion({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_if_match_version::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_if_match_version_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KeyGroupAlreadyExists" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::KeyGroupAlreadyExists({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::key_group_already_exists::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_key_group_already_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchResource" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::NoSuchResource({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_resource::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_no_such_resource_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"PreconditionFailed" => {
crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::PreconditionFailed({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::precondition_failed::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_precondition_failed_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"TooManyPublicKeysInKeyGroup" => crate::error::UpdateKeyGroupError {
meta: generic,
kind: crate::error::UpdateKeyGroupErrorKind::TooManyPublicKeysInKeyGroup({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::too_many_public_keys_in_key_group::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_public_keys_in_key_group_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateKeyGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateKeyGroupError::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_invalid_argument(&self) -> bool
pub fn is_invalid_argument(&self) -> bool
Returns true
if the error kind is UpdateKeyGroupErrorKind::InvalidArgument
.
sourcepub fn is_invalid_if_match_version(&self) -> bool
pub fn is_invalid_if_match_version(&self) -> bool
Returns true
if the error kind is UpdateKeyGroupErrorKind::InvalidIfMatchVersion
.
sourcepub fn is_key_group_already_exists(&self) -> bool
pub fn is_key_group_already_exists(&self) -> bool
Returns true
if the error kind is UpdateKeyGroupErrorKind::KeyGroupAlreadyExists
.
sourcepub fn is_no_such_resource(&self) -> bool
pub fn is_no_such_resource(&self) -> bool
Returns true
if the error kind is UpdateKeyGroupErrorKind::NoSuchResource
.
sourcepub fn is_precondition_failed(&self) -> bool
pub fn is_precondition_failed(&self) -> bool
Returns true
if the error kind is UpdateKeyGroupErrorKind::PreconditionFailed
.
sourcepub fn is_too_many_public_keys_in_key_group(&self) -> bool
pub fn is_too_many_public_keys_in_key_group(&self) -> bool
Returns true
if the error kind is UpdateKeyGroupErrorKind::TooManyPublicKeysInKeyGroup
.