#[non_exhaustive]pub struct DeleteDirectConnectGatewayAssociationProposalError {
pub kind: DeleteDirectConnectGatewayAssociationProposalErrorKind,
/* private fields */
}Expand description
Error type for the DeleteDirectConnectGatewayAssociationProposal 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: DeleteDirectConnectGatewayAssociationProposalErrorKindKind of error that occurred.
Implementations§
source§impl DeleteDirectConnectGatewayAssociationProposalError
impl DeleteDirectConnectGatewayAssociationProposalError
sourcepub fn new(
kind: DeleteDirectConnectGatewayAssociationProposalErrorKind,
meta: Error
) -> Self
pub fn new(
kind: DeleteDirectConnectGatewayAssociationProposalErrorKind,
meta: Error
) -> Self
Creates a new DeleteDirectConnectGatewayAssociationProposalError.
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 DeleteDirectConnectGatewayAssociationProposalError::Unhandled variant from any error type.
Examples found in repository?
2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673
pub fn parse_delete_direct_connect_gateway_association_proposal_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteDirectConnectGatewayAssociationProposalOutput,
crate::error::DeleteDirectConnectGatewayAssociationProposalError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled(
generic,
),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DirectConnectClientException" => crate::error::DeleteDirectConnectGatewayAssociationProposalError { meta: generic, kind: crate::error::DeleteDirectConnectGatewayAssociationProposalErrorKind::DirectConnectClientException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::direct_connect_client_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_direct_connect_client_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"DirectConnectServerException" => crate::error::DeleteDirectConnectGatewayAssociationProposalError { meta: generic, kind: crate::error::DeleteDirectConnectGatewayAssociationProposalErrorKind::DirectConnectServerException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::direct_connect_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_direct_connect_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DeleteDirectConnectGatewayAssociationProposalError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteDirectConnectGatewayAssociationProposalError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673
pub fn parse_delete_direct_connect_gateway_association_proposal_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteDirectConnectGatewayAssociationProposalOutput,
crate::error::DeleteDirectConnectGatewayAssociationProposalError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled(
generic,
),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DirectConnectClientException" => crate::error::DeleteDirectConnectGatewayAssociationProposalError { meta: generic, kind: crate::error::DeleteDirectConnectGatewayAssociationProposalErrorKind::DirectConnectClientException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::direct_connect_client_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_direct_connect_client_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"DirectConnectServerException" => crate::error::DeleteDirectConnectGatewayAssociationProposalError { meta: generic, kind: crate::error::DeleteDirectConnectGatewayAssociationProposalErrorKind::DirectConnectServerException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::direct_connect_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_direct_connect_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteDirectConnectGatewayAssociationProposalError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DeleteDirectConnectGatewayAssociationProposalError::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_direct_connect_client_exception(&self) -> bool
pub fn is_direct_connect_client_exception(&self) -> bool
Returns true if the error kind is DeleteDirectConnectGatewayAssociationProposalErrorKind::DirectConnectClientException.
sourcepub fn is_direct_connect_server_exception(&self) -> bool
pub fn is_direct_connect_server_exception(&self) -> bool
Returns true if the error kind is DeleteDirectConnectGatewayAssociationProposalErrorKind::DirectConnectServerException.