Struct aws_sdk_cloudfront::error::DeleteFunctionError
source · #[non_exhaustive]pub struct DeleteFunctionError {
pub kind: DeleteFunctionErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteFunction
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: DeleteFunctionErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteFunctionError
impl DeleteFunctionError
sourcepub fn new(kind: DeleteFunctionErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteFunctionErrorKind, meta: Error) -> Self
Creates a new DeleteFunctionError
.
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 DeleteFunctionError::Unhandled
variant from any error type.
Examples found in repository?
4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010
pub fn parse_delete_function_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteFunctionOutput, crate::error::DeleteFunctionError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteFunctionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteFunctionError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"FunctionInUse" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::FunctionInUse({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::function_in_use::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_function_in_use_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIfMatchVersion" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::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::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchFunctionExists" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::NoSuchFunctionExists({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_function_exists::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_function_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"PreconditionFailed" => {
crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::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::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"UnsupportedOperation" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::UnsupportedOperation({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unsupported_operation::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_unsupported_operation_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteFunctionError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteFunctionError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010
pub fn parse_delete_function_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteFunctionOutput, crate::error::DeleteFunctionError> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteFunctionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteFunctionError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"FunctionInUse" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::FunctionInUse({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::function_in_use::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_function_in_use_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIfMatchVersion" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::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::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchFunctionExists" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::NoSuchFunctionExists({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_function_exists::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_function_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"PreconditionFailed" => {
crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::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::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"UnsupportedOperation" => crate::error::DeleteFunctionError {
meta: generic,
kind: crate::error::DeleteFunctionErrorKind::UnsupportedOperation({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unsupported_operation::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_unsupported_operation_xml_err(response.body().as_ref(), output).map_err(crate::error::DeleteFunctionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteFunctionError::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_function_in_use(&self) -> bool
pub fn is_function_in_use(&self) -> bool
Returns true
if the error kind is DeleteFunctionErrorKind::FunctionInUse
.
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 DeleteFunctionErrorKind::InvalidIfMatchVersion
.
sourcepub fn is_no_such_function_exists(&self) -> bool
pub fn is_no_such_function_exists(&self) -> bool
Returns true
if the error kind is DeleteFunctionErrorKind::NoSuchFunctionExists
.
sourcepub fn is_precondition_failed(&self) -> bool
pub fn is_precondition_failed(&self) -> bool
Returns true
if the error kind is DeleteFunctionErrorKind::PreconditionFailed
.
sourcepub fn is_unsupported_operation(&self) -> bool
pub fn is_unsupported_operation(&self) -> bool
Returns true
if the error kind is DeleteFunctionErrorKind::UnsupportedOperation
.