#[non_exhaustive]pub struct UpdateDirectConnectGatewayAssociationError {
pub kind: UpdateDirectConnectGatewayAssociationErrorKind,
/* private fields */
}Expand description
Error type for the UpdateDirectConnectGatewayAssociation operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: UpdateDirectConnectGatewayAssociationErrorKindKind of error that occurred.
Implementations§
source§impl UpdateDirectConnectGatewayAssociationError
impl UpdateDirectConnectGatewayAssociationError
sourcepub fn new(
kind: UpdateDirectConnectGatewayAssociationErrorKind,
meta: Error
) -> Self
pub fn new(
kind: UpdateDirectConnectGatewayAssociationErrorKind,
meta: Error
) -> Self
Creates a new UpdateDirectConnectGatewayAssociationError.
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 UpdateDirectConnectGatewayAssociationError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 5003)
4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040
pub fn parse_update_direct_connect_gateway_association_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdateDirectConnectGatewayAssociationOutput,
crate::error::UpdateDirectConnectGatewayAssociationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateDirectConnectGatewayAssociationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::UpdateDirectConnectGatewayAssociationError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DirectConnectClientException" => crate::error::UpdateDirectConnectGatewayAssociationError { meta: generic, kind: crate::error::UpdateDirectConnectGatewayAssociationErrorKind::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::UpdateDirectConnectGatewayAssociationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"DirectConnectServerException" => crate::error::UpdateDirectConnectGatewayAssociationError { meta: generic, kind: crate::error::UpdateDirectConnectGatewayAssociationErrorKind::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::UpdateDirectConnectGatewayAssociationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::UpdateDirectConnectGatewayAssociationError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateDirectConnectGatewayAssociationError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 5038)
4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040
pub fn parse_update_direct_connect_gateway_association_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdateDirectConnectGatewayAssociationOutput,
crate::error::UpdateDirectConnectGatewayAssociationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateDirectConnectGatewayAssociationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::UpdateDirectConnectGatewayAssociationError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DirectConnectClientException" => crate::error::UpdateDirectConnectGatewayAssociationError { meta: generic, kind: crate::error::UpdateDirectConnectGatewayAssociationErrorKind::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::UpdateDirectConnectGatewayAssociationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"DirectConnectServerException" => crate::error::UpdateDirectConnectGatewayAssociationError { meta: generic, kind: crate::error::UpdateDirectConnectGatewayAssociationErrorKind::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::UpdateDirectConnectGatewayAssociationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::UpdateDirectConnectGatewayAssociationError::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 UpdateDirectConnectGatewayAssociationErrorKind::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 UpdateDirectConnectGatewayAssociationErrorKind::DirectConnectServerException.
Trait Implementations§
source§impl Error for UpdateDirectConnectGatewayAssociationError
impl Error for UpdateDirectConnectGatewayAssociationError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<UpdateDirectConnectGatewayAssociationError> for Error
impl From<UpdateDirectConnectGatewayAssociationError> for Error
source§fn from(err: UpdateDirectConnectGatewayAssociationError) -> Self
fn from(err: UpdateDirectConnectGatewayAssociationError) -> Self
Converts to this type from the input type.