Struct aws_sdk_elasticache::error::DescribeSnapshotsError
source · #[non_exhaustive]pub struct DescribeSnapshotsError {
pub kind: DescribeSnapshotsErrorKind,
/* private fields */
}
Expand description
Error type for the DescribeSnapshots
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: DescribeSnapshotsErrorKind
Kind of error that occurred.
Implementations§
source§impl DescribeSnapshotsError
impl DescribeSnapshotsError
sourcepub fn new(kind: DescribeSnapshotsErrorKind, meta: Error) -> Self
pub fn new(kind: DescribeSnapshotsErrorKind, meta: Error) -> Self
Creates a new DescribeSnapshotsError
.
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 DescribeSnapshotsError::Unhandled
variant from any error type.
Examples found in repository?
4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895
pub fn parse_describe_snapshots_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DescribeSnapshotsOutput, crate::error::DescribeSnapshotsError>
{
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeSnapshotsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DescribeSnapshotsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheClusterNotFound" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::CacheClusterNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_cluster_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_cluster_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterCombination" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::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::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValue" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::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::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotNotFoundFault" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::SnapshotNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::snapshot_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DescribeSnapshotsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DescribeSnapshotsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895
pub fn parse_describe_snapshots_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DescribeSnapshotsOutput, crate::error::DescribeSnapshotsError>
{
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeSnapshotsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DescribeSnapshotsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheClusterNotFound" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::CacheClusterNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_cluster_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_cluster_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterCombination" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::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::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValue" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::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::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotNotFoundFault" => crate::error::DescribeSnapshotsError {
meta: generic,
kind: crate::error::DescribeSnapshotsErrorKind::SnapshotNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::snapshot_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeSnapshotsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DescribeSnapshotsError::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_cluster_not_found_fault(&self) -> bool
pub fn is_cache_cluster_not_found_fault(&self) -> bool
Returns true
if the error kind is DescribeSnapshotsErrorKind::CacheClusterNotFoundFault
.
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 DescribeSnapshotsErrorKind::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 DescribeSnapshotsErrorKind::InvalidParameterValueException
.
sourcepub fn is_snapshot_not_found_fault(&self) -> bool
pub fn is_snapshot_not_found_fault(&self) -> bool
Returns true
if the error kind is DescribeSnapshotsErrorKind::SnapshotNotFoundFault
.