#[non_exhaustive]pub struct ResetCacheParameterGroupError {
pub kind: ResetCacheParameterGroupErrorKind,
/* private fields */
}
Expand description
Error type for the ResetCacheParameterGroup
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: ResetCacheParameterGroupErrorKind
Kind of error that occurred.
Implementations§
source§impl ResetCacheParameterGroupError
impl ResetCacheParameterGroupError
sourcepub fn new(kind: ResetCacheParameterGroupErrorKind, meta: Error) -> Self
pub fn new(kind: ResetCacheParameterGroupErrorKind, meta: Error) -> Self
Creates a new ResetCacheParameterGroupError
.
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 ResetCacheParameterGroupError::Unhandled
variant from any error type.
Examples found in repository?
7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039
pub fn parse_reset_cache_parameter_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ResetCacheParameterGroupOutput,
crate::error::ResetCacheParameterGroupError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ResetCacheParameterGroupError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheParameterGroupNotFound" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::CacheParameterGroupNotFoundFault({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cache_parameter_group_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_parameter_group_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidCacheParameterGroupState" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidCacheParameterGroupStateFault({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_cache_parameter_group_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_cache_parameter_group_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidGlobalReplicationGroupState" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidGlobalReplicationGroupStateFault({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_global_replication_group_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_global_replication_group_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterCombination" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidParameterCombinationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_combination_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_parameter_combination_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterValue" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_parameter_value_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::ResetCacheParameterGroupError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ResetCacheParameterGroupError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039
pub fn parse_reset_cache_parameter_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ResetCacheParameterGroupOutput,
crate::error::ResetCacheParameterGroupError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ResetCacheParameterGroupError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheParameterGroupNotFound" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::CacheParameterGroupNotFoundFault({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cache_parameter_group_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_parameter_group_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidCacheParameterGroupState" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidCacheParameterGroupStateFault({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_cache_parameter_group_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_cache_parameter_group_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidGlobalReplicationGroupState" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidGlobalReplicationGroupStateFault({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_global_replication_group_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_global_replication_group_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterCombination" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidParameterCombinationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_combination_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_parameter_combination_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterValue" => crate::error::ResetCacheParameterGroupError { meta: generic, kind: crate::error::ResetCacheParameterGroupErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_parameter_value_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::ResetCacheParameterGroupError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::ResetCacheParameterGroupError::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_cache_parameter_group_not_found_fault(&self) -> bool
pub fn is_cache_parameter_group_not_found_fault(&self) -> bool
Returns true
if the error kind is ResetCacheParameterGroupErrorKind::CacheParameterGroupNotFoundFault
.
sourcepub fn is_invalid_cache_parameter_group_state_fault(&self) -> bool
pub fn is_invalid_cache_parameter_group_state_fault(&self) -> bool
Returns true
if the error kind is ResetCacheParameterGroupErrorKind::InvalidCacheParameterGroupStateFault
.
sourcepub fn is_invalid_global_replication_group_state_fault(&self) -> bool
pub fn is_invalid_global_replication_group_state_fault(&self) -> bool
Returns true
if the error kind is ResetCacheParameterGroupErrorKind::InvalidGlobalReplicationGroupStateFault
.
sourcepub fn is_invalid_parameter_combination_exception(&self) -> bool
pub fn is_invalid_parameter_combination_exception(&self) -> bool
Returns true
if the error kind is ResetCacheParameterGroupErrorKind::InvalidParameterCombinationException
.
sourcepub fn is_invalid_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true
if the error kind is ResetCacheParameterGroupErrorKind::InvalidParameterValueException
.