#[non_exhaustive]pub struct CreateTopicRuleDestinationError {
pub kind: CreateTopicRuleDestinationErrorKind,
/* private fields */
}
Expand description
Error type for the CreateTopicRuleDestination
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: CreateTopicRuleDestinationErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateTopicRuleDestinationError
impl CreateTopicRuleDestinationError
sourcepub fn new(kind: CreateTopicRuleDestinationErrorKind, meta: Error) -> Self
pub fn new(kind: CreateTopicRuleDestinationErrorKind, meta: Error) -> Self
Creates a new CreateTopicRuleDestinationError
.
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 CreateTopicRuleDestinationError::Unhandled
variant from any error type.
Examples found in repository?
6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091
pub fn parse_create_topic_rule_destination_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateTopicRuleDestinationOutput,
crate::error::CreateTopicRuleDestinationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateTopicRuleDestinationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateTopicRuleDestinationError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingResourceUpdateException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::ConflictingResourceUpdateException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::conflicting_resource_update_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_resource_update_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::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::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::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::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceAlreadyExistsException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::ResourceAlreadyExistsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_already_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_already_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServiceUnavailableException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::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::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::CreateTopicRuleDestinationError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateTopicRuleDestinationError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091
pub fn parse_create_topic_rule_destination_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateTopicRuleDestinationOutput,
crate::error::CreateTopicRuleDestinationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateTopicRuleDestinationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateTopicRuleDestinationError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingResourceUpdateException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::ConflictingResourceUpdateException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::conflicting_resource_update_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_resource_update_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::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::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::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::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceAlreadyExistsException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::ResourceAlreadyExistsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_already_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_already_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServiceUnavailableException" => crate::error::CreateTopicRuleDestinationError { meta: generic, kind: crate::error::CreateTopicRuleDestinationErrorKind::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::CreateTopicRuleDestinationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::CreateTopicRuleDestinationError::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_conflicting_resource_update_exception(&self) -> bool
pub fn is_conflicting_resource_update_exception(&self) -> bool
Returns true
if the error kind is CreateTopicRuleDestinationErrorKind::ConflictingResourceUpdateException
.
sourcepub fn is_internal_exception(&self) -> bool
pub fn is_internal_exception(&self) -> bool
Returns true
if the error kind is CreateTopicRuleDestinationErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is CreateTopicRuleDestinationErrorKind::InvalidRequestException
.
sourcepub fn is_resource_already_exists_exception(&self) -> bool
pub fn is_resource_already_exists_exception(&self) -> bool
Returns true
if the error kind is CreateTopicRuleDestinationErrorKind::ResourceAlreadyExistsException
.
Returns true
if the error kind is CreateTopicRuleDestinationErrorKind::ServiceUnavailableException
.