Struct aws_sdk_elasticache::error::CreateSnapshotError
source · #[non_exhaustive]pub struct CreateSnapshotError {
pub kind: CreateSnapshotErrorKind,
/* private fields */
}
Expand description
Error type for the CreateSnapshot
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: CreateSnapshotErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateSnapshotError
impl CreateSnapshotError
sourcepub fn new(kind: CreateSnapshotErrorKind, meta: Error) -> Self
pub fn new(kind: CreateSnapshotErrorKind, meta: Error) -> Self
Creates a new CreateSnapshotError
.
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 CreateSnapshotError::Unhandled
variant from any error type.
Examples found in repository?
1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083
pub fn parse_create_snapshot_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateSnapshotOutput, crate::error::CreateSnapshotError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateSnapshotError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateSnapshotError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheClusterNotFound" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::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::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidCacheClusterState" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::InvalidCacheClusterStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_cache_cluster_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_cache_cluster_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterCombination" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::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::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValue" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::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::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidReplicationGroupState" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::InvalidReplicationGroupStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_replication_group_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_replication_group_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ReplicationGroupNotFoundFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::ReplicationGroupNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::replication_group_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_replication_group_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotAlreadyExistsFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::SnapshotAlreadyExistsFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::snapshot_already_exists_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_already_exists_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotFeatureNotSupportedFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::SnapshotFeatureNotSupportedFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::snapshot_feature_not_supported_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_feature_not_supported_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotQuotaExceededFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::SnapshotQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::snapshot_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_quota_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TagQuotaPerResourceExceeded" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::TagQuotaPerResourceExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::tag_quota_per_resource_exceeded::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_tag_quota_per_resource_exceeded_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateSnapshotError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateSnapshotError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083
pub fn parse_create_snapshot_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateSnapshotOutput, crate::error::CreateSnapshotError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateSnapshotError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateSnapshotError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheClusterNotFound" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::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::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidCacheClusterState" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::InvalidCacheClusterStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_cache_cluster_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_cache_cluster_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterCombination" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::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::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValue" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::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::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidReplicationGroupState" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::InvalidReplicationGroupStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_replication_group_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_replication_group_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ReplicationGroupNotFoundFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::ReplicationGroupNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::replication_group_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_replication_group_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotAlreadyExistsFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::SnapshotAlreadyExistsFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::snapshot_already_exists_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_already_exists_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotFeatureNotSupportedFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::SnapshotFeatureNotSupportedFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::snapshot_feature_not_supported_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_feature_not_supported_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SnapshotQuotaExceededFault" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::SnapshotQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::snapshot_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_snapshot_quota_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TagQuotaPerResourceExceeded" => crate::error::CreateSnapshotError {
meta: generic,
kind: crate::error::CreateSnapshotErrorKind::TagQuotaPerResourceExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::tag_quota_per_resource_exceeded::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_tag_quota_per_resource_exceeded_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateSnapshotError::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 CreateSnapshotErrorKind::CacheClusterNotFoundFault
.
sourcepub fn is_invalid_cache_cluster_state_fault(&self) -> bool
pub fn is_invalid_cache_cluster_state_fault(&self) -> bool
Returns true
if the error kind is CreateSnapshotErrorKind::InvalidCacheClusterStateFault
.
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 CreateSnapshotErrorKind::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 CreateSnapshotErrorKind::InvalidParameterValueException
.
sourcepub fn is_invalid_replication_group_state_fault(&self) -> bool
pub fn is_invalid_replication_group_state_fault(&self) -> bool
Returns true
if the error kind is CreateSnapshotErrorKind::InvalidReplicationGroupStateFault
.
sourcepub fn is_replication_group_not_found_fault(&self) -> bool
pub fn is_replication_group_not_found_fault(&self) -> bool
Returns true
if the error kind is CreateSnapshotErrorKind::ReplicationGroupNotFoundFault
.
sourcepub fn is_snapshot_already_exists_fault(&self) -> bool
pub fn is_snapshot_already_exists_fault(&self) -> bool
Returns true
if the error kind is CreateSnapshotErrorKind::SnapshotAlreadyExistsFault
.
sourcepub fn is_snapshot_feature_not_supported_fault(&self) -> bool
pub fn is_snapshot_feature_not_supported_fault(&self) -> bool
Returns true
if the error kind is CreateSnapshotErrorKind::SnapshotFeatureNotSupportedFault
.
sourcepub fn is_snapshot_quota_exceeded_fault(&self) -> bool
pub fn is_snapshot_quota_exceeded_fault(&self) -> bool
Returns true
if the error kind is CreateSnapshotErrorKind::SnapshotQuotaExceededFault
.
sourcepub fn is_tag_quota_per_resource_exceeded(&self) -> bool
pub fn is_tag_quota_per_resource_exceeded(&self) -> bool
Returns true
if the error kind is CreateSnapshotErrorKind::TagQuotaPerResourceExceeded
.