Struct aws_sdk_iot::error::GetTopicRuleDestinationError
source · #[non_exhaustive]pub struct GetTopicRuleDestinationError {
pub kind: GetTopicRuleDestinationErrorKind,
/* private fields */
}
Expand description
Error type for the GetTopicRuleDestination
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: GetTopicRuleDestinationErrorKind
Kind of error that occurred.
Implementations§
source§impl GetTopicRuleDestinationError
impl GetTopicRuleDestinationError
sourcepub fn new(kind: GetTopicRuleDestinationErrorKind, meta: Error) -> Self
pub fn new(kind: GetTopicRuleDestinationErrorKind, meta: Error) -> Self
Creates a new GetTopicRuleDestinationError
.
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 GetTopicRuleDestinationError::Unhandled
variant from any error type.
Examples found in repository?
16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845
pub fn parse_get_topic_rule_destination_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetTopicRuleDestinationOutput,
crate::error::GetTopicRuleDestinationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetTopicRuleDestinationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetTopicRuleDestinationError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetTopicRuleDestinationError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetTopicRuleDestinationError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
16753 16754 16755 16756 16757 16758 16759 16760 16761 16762 16763 16764 16765 16766 16767 16768 16769 16770 16771 16772 16773 16774 16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 16786 16787 16788 16789 16790 16791 16792 16793 16794 16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 16805 16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 16817 16818 16819 16820 16821 16822 16823 16824 16825 16826 16827 16828 16829 16830 16831 16832 16833 16834 16835 16836 16837 16838 16839 16840 16841 16842 16843 16844 16845
pub fn parse_get_topic_rule_destination_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetTopicRuleDestinationOutput,
crate::error::GetTopicRuleDestinationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetTopicRuleDestinationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetTopicRuleDestinationError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::GetTopicRuleDestinationError {
meta: generic,
kind: crate::error::GetTopicRuleDestinationErrorKind::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::GetTopicRuleDestinationError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetTopicRuleDestinationError::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 GetTopicRuleDestinationErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is GetTopicRuleDestinationErrorKind::InvalidRequestException
.
Returns true
if the error kind is GetTopicRuleDestinationErrorKind::ServiceUnavailableException
.
Returns true
if the error kind is GetTopicRuleDestinationErrorKind::UnauthorizedException
.