Struct aws_sdk_iot::error::ListTopicRuleDestinationsError
source · #[non_exhaustive]pub struct ListTopicRuleDestinationsError {
pub kind: ListTopicRuleDestinationsErrorKind,
/* private fields */
}
Expand description
Error type for the ListTopicRuleDestinations
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: ListTopicRuleDestinationsErrorKind
Kind of error that occurred.
Implementations§
source§impl ListTopicRuleDestinationsError
impl ListTopicRuleDestinationsError
sourcepub fn new(kind: ListTopicRuleDestinationsErrorKind, meta: Error) -> Self
pub fn new(kind: ListTopicRuleDestinationsErrorKind, meta: Error) -> Self
Creates a new ListTopicRuleDestinationsError
.
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 ListTopicRuleDestinationsError::Unhandled
variant from any error type.
Examples found in repository?
22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 22919 22920 22921 22922 22923 22924 22925 22926 22927 22928 22929 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 22945 22946 22947 22948 22949 22950 22951 22952 22953 22954 22955 22956 22957 22958 22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 22989
pub fn parse_list_topic_rule_destinations_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListTopicRuleDestinationsOutput,
crate::error::ListTopicRuleDestinationsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListTopicRuleDestinationsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListTopicRuleDestinationsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListTopicRuleDestinationsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
22897 22898 22899 22900 22901 22902 22903 22904 22905 22906 22907 22908 22909 22910 22911 22912 22913 22914 22915 22916 22917 22918 22919 22920 22921 22922 22923 22924 22925 22926 22927 22928 22929 22930 22931 22932 22933 22934 22935 22936 22937 22938 22939 22940 22941 22942 22943 22944 22945 22946 22947 22948 22949 22950 22951 22952 22953 22954 22955 22956 22957 22958 22959 22960 22961 22962 22963 22964 22965 22966 22967 22968 22969 22970 22971 22972 22973 22974 22975 22976 22977 22978 22979 22980 22981 22982 22983 22984 22985 22986 22987 22988 22989
pub fn parse_list_topic_rule_destinations_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListTopicRuleDestinationsOutput,
crate::error::ListTopicRuleDestinationsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListTopicRuleDestinationsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::ListTopicRuleDestinationsError {
meta: generic,
kind: crate::error::ListTopicRuleDestinationsErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTopicRuleDestinationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListTopicRuleDestinationsError::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_internal_exception(&self) -> bool
pub fn is_internal_exception(&self) -> bool
Returns true
if the error kind is ListTopicRuleDestinationsErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is ListTopicRuleDestinationsErrorKind::InvalidRequestException
.
Returns true
if the error kind is ListTopicRuleDestinationsErrorKind::ServiceUnavailableException
.
Returns true
if the error kind is ListTopicRuleDestinationsErrorKind::UnauthorizedException
.