#[non_exhaustive]pub struct GetTransitGatewayPeeringError {
pub kind: GetTransitGatewayPeeringErrorKind,
/* private fields */
}Expand description
Error type for the GetTransitGatewayPeering 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: GetTransitGatewayPeeringErrorKindKind of error that occurred.
Implementations§
source§impl GetTransitGatewayPeeringError
impl GetTransitGatewayPeeringError
sourcepub fn new(kind: GetTransitGatewayPeeringErrorKind, meta: Error) -> Self
pub fn new(kind: GetTransitGatewayPeeringErrorKind, meta: Error) -> Self
Creates a new GetTransitGatewayPeeringError.
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 GetTransitGatewayPeeringError::Unhandled variant from any error type.
Examples found in repository?
8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353
pub fn parse_get_transit_gateway_peering_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetTransitGatewayPeeringOutput,
crate::error::GetTransitGatewayPeeringError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetTransitGatewayPeeringError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetTransitGatewayPeeringError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_peering_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayPeeringError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_peering_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayPeeringError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetTransitGatewayPeeringError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetTransitGatewayPeeringError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353
pub fn parse_get_transit_gateway_peering_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetTransitGatewayPeeringOutput,
crate::error::GetTransitGatewayPeeringError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetTransitGatewayPeeringError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetTransitGatewayPeeringError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_peering_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayPeeringError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_transit_gateway_peering_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetTransitGatewayPeeringError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::GetTransitGatewayPeeringError {
meta: generic,
kind: crate::error::GetTransitGatewayPeeringErrorKind::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::GetTransitGatewayPeeringError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetTransitGatewayPeeringError::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 GetTransitGatewayPeeringErrorKind::AccessDeniedException.
sourcepub fn is_internal_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayPeeringErrorKind::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 GetTransitGatewayPeeringErrorKind::ResourceNotFoundException.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayPeeringErrorKind::ThrottlingException.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true if the error kind is GetTransitGatewayPeeringErrorKind::ValidationException.