#[non_exhaustive]pub struct GetTransitGatewayRouteTableAttachmentError {
pub kind: GetTransitGatewayRouteTableAttachmentErrorKind,
/* private fields */
}Expand description
Error type for the GetTransitGatewayRouteTableAttachment 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: GetTransitGatewayRouteTableAttachmentErrorKindKind of error that occurred.
Implementations§
source§impl GetTransitGatewayRouteTableAttachmentError
impl GetTransitGatewayRouteTableAttachmentError
sourcepub fn new(
kind: GetTransitGatewayRouteTableAttachmentErrorKind,
meta: Error
) -> Self
pub fn new(
kind: GetTransitGatewayRouteTableAttachmentErrorKind,
meta: Error
) -> Self
Creates a new GetTransitGatewayRouteTableAttachmentError.
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 GetTransitGatewayRouteTableAttachmentError::Unhandled variant from any error type.
Examples found in repository?
8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613
pub fn parse_get_transit_gateway_route_table_attachment_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetTransitGatewayRouteTableAttachmentOutput,
crate::error::GetTransitGatewayRouteTableAttachmentError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::AccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::InternalServerException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_route_table_attachment_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ThrottlingException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::ThrottlingException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_route_table_attachment_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetTransitGatewayRouteTableAttachmentError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetTransitGatewayRouteTableAttachmentError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613
pub fn parse_get_transit_gateway_route_table_attachment_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetTransitGatewayRouteTableAttachmentOutput,
crate::error::GetTransitGatewayRouteTableAttachmentError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::AccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::InternalServerException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_route_table_attachment_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ThrottlingException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::ThrottlingException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_route_table_attachment_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::GetTransitGatewayRouteTableAttachmentError { meta: generic, kind: crate::error::GetTransitGatewayRouteTableAttachmentErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetTransitGatewayRouteTableAttachmentError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetTransitGatewayRouteTableAttachmentError::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_access_denied_exception(&self) -> bool
pub fn is_access_denied_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayRouteTableAttachmentErrorKind::AccessDeniedException.
sourcepub fn is_internal_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayRouteTableAttachmentErrorKind::InternalServerException.
sourcepub fn is_resource_not_found_exception(&self) -> bool
pub fn is_resource_not_found_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayRouteTableAttachmentErrorKind::ResourceNotFoundException.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayRouteTableAttachmentErrorKind::ThrottlingException.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayRouteTableAttachmentErrorKind::ValidationException.