#[non_exhaustive]pub struct GetSiteToSiteVpnAttachmentError {
pub kind: GetSiteToSiteVpnAttachmentErrorKind,
/* private fields */
}Expand description
Error type for the GetSiteToSiteVpnAttachment 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: GetSiteToSiteVpnAttachmentErrorKindKind of error that occurred.
Implementations§
source§impl GetSiteToSiteVpnAttachmentError
impl GetSiteToSiteVpnAttachmentError
sourcepub fn new(kind: GetSiteToSiteVpnAttachmentErrorKind, meta: Error) -> Self
pub fn new(kind: GetSiteToSiteVpnAttachmentErrorKind, meta: Error) -> Self
Creates a new GetSiteToSiteVpnAttachmentError.
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 GetSiteToSiteVpnAttachmentError::Unhandled variant from any error type.
Examples found in repository?
7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082
pub fn parse_get_site_to_site_vpn_attachment_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetSiteToSiteVpnAttachmentOutput,
crate::error::GetSiteToSiteVpnAttachmentError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetSiteToSiteVpnAttachmentError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetSiteToSiteVpnAttachmentError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_site_to_site_vpn_attachment_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetSiteToSiteVpnAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_site_to_site_vpn_attachment_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetSiteToSiteVpnAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetSiteToSiteVpnAttachmentError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetSiteToSiteVpnAttachmentError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082
pub fn parse_get_site_to_site_vpn_attachment_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetSiteToSiteVpnAttachmentOutput,
crate::error::GetSiteToSiteVpnAttachmentError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetSiteToSiteVpnAttachmentError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetSiteToSiteVpnAttachmentError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_site_to_site_vpn_attachment_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetSiteToSiteVpnAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_site_to_site_vpn_attachment_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetSiteToSiteVpnAttachmentError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::GetSiteToSiteVpnAttachmentError {
meta: generic,
kind: crate::error::GetSiteToSiteVpnAttachmentErrorKind::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::GetSiteToSiteVpnAttachmentError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetSiteToSiteVpnAttachmentError::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 GetSiteToSiteVpnAttachmentErrorKind::AccessDeniedException.
sourcepub fn is_internal_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true if the error kind is GetSiteToSiteVpnAttachmentErrorKind::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 GetSiteToSiteVpnAttachmentErrorKind::ResourceNotFoundException.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true if the error kind is GetSiteToSiteVpnAttachmentErrorKind::ThrottlingException.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true if the error kind is GetSiteToSiteVpnAttachmentErrorKind::ValidationException.