Struct aws_sdk_lambda::error::ListFunctionsError
source · #[non_exhaustive]pub struct ListFunctionsError {
pub kind: ListFunctionsErrorKind,
/* private fields */
}
Expand description
Error type for the ListFunctions
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: ListFunctionsErrorKind
Kind of error that occurred.
Implementations§
source§impl ListFunctionsError
impl ListFunctionsError
sourcepub fn new(kind: ListFunctionsErrorKind, meta: Error) -> Self
pub fn new(kind: ListFunctionsErrorKind, meta: Error) -> Self
Creates a new ListFunctionsError
.
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 ListFunctionsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 4885)
4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 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
pub fn parse_list_functions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListFunctionsOutput, crate::error::ListFunctionsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListFunctionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListFunctionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterValueException" => crate::error::ListFunctionsError {
meta: generic,
kind: crate::error::ListFunctionsErrorKind::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::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFunctionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceException" => {
crate::error::ListFunctionsError {
meta: generic,
kind: crate::error::ListFunctionsErrorKind::ServiceException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFunctionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"TooManyRequestsException" => crate::error::ListFunctionsError {
meta: generic,
kind: crate::error::ListFunctionsErrorKind::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFunctionsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_functions_too_many_requests_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListFunctionsError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListFunctionsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListFunctionsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 4948)
4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 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
pub fn parse_list_functions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListFunctionsOutput, crate::error::ListFunctionsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListFunctionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListFunctionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterValueException" => crate::error::ListFunctionsError {
meta: generic,
kind: crate::error::ListFunctionsErrorKind::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::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFunctionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceException" => {
crate::error::ListFunctionsError {
meta: generic,
kind: crate::error::ListFunctionsErrorKind::ServiceException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFunctionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"TooManyRequestsException" => crate::error::ListFunctionsError {
meta: generic,
kind: crate::error::ListFunctionsErrorKind::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFunctionsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_functions_too_many_requests_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListFunctionsError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListFunctionsError::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_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true
if the error kind is ListFunctionsErrorKind::InvalidParameterValueException
.
sourcepub fn is_service_exception(&self) -> bool
pub fn is_service_exception(&self) -> bool
Returns true
if the error kind is ListFunctionsErrorKind::ServiceException
.
sourcepub fn is_too_many_requests_exception(&self) -> bool
pub fn is_too_many_requests_exception(&self) -> bool
Returns true
if the error kind is ListFunctionsErrorKind::TooManyRequestsException
.
Trait Implementations§
source§impl Debug for ListFunctionsError
impl Debug for ListFunctionsError
source§impl Display for ListFunctionsError
impl Display for ListFunctionsError
source§impl Error for ListFunctionsError
impl Error for ListFunctionsError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ListFunctionsError> for Error
impl From<ListFunctionsError> for Error
source§fn from(err: ListFunctionsError) -> Self
fn from(err: ListFunctionsError) -> Self
Converts to this type from the input type.