#[non_exhaustive]pub struct DeleteDirectConnectGatewayError {
pub kind: DeleteDirectConnectGatewayErrorKind,
/* private fields */
}Expand description
Error type for the DeleteDirectConnectGateway 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: DeleteDirectConnectGatewayErrorKindKind of error that occurred.
Implementations§
source§impl DeleteDirectConnectGatewayError
impl DeleteDirectConnectGatewayError
sourcepub fn new(kind: DeleteDirectConnectGatewayErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteDirectConnectGatewayErrorKind, meta: Error) -> Self
Creates a new DeleteDirectConnectGatewayError.
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 DeleteDirectConnectGatewayError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (lines 2480-2482)
2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530
pub fn parse_delete_direct_connect_gateway_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteDirectConnectGatewayOutput,
crate::error::DeleteDirectConnectGatewayError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteDirectConnectGatewayError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DeleteDirectConnectGatewayError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DirectConnectClientException" => crate::error::DeleteDirectConnectGatewayError {
meta: generic,
kind: crate::error::DeleteDirectConnectGatewayErrorKind::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::DeleteDirectConnectGatewayError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"DirectConnectServerException" => crate::error::DeleteDirectConnectGatewayError {
meta: generic,
kind: crate::error::DeleteDirectConnectGatewayErrorKind::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::DeleteDirectConnectGatewayError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::DeleteDirectConnectGatewayError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteDirectConnectGatewayError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 2528)
2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530
pub fn parse_delete_direct_connect_gateway_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteDirectConnectGatewayOutput,
crate::error::DeleteDirectConnectGatewayError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteDirectConnectGatewayError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DeleteDirectConnectGatewayError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DirectConnectClientException" => crate::error::DeleteDirectConnectGatewayError {
meta: generic,
kind: crate::error::DeleteDirectConnectGatewayErrorKind::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::DeleteDirectConnectGatewayError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"DirectConnectServerException" => crate::error::DeleteDirectConnectGatewayError {
meta: generic,
kind: crate::error::DeleteDirectConnectGatewayErrorKind::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::DeleteDirectConnectGatewayError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::DeleteDirectConnectGatewayError::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 DeleteDirectConnectGatewayErrorKind::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 DeleteDirectConnectGatewayErrorKind::DirectConnectServerException.
Trait Implementations§
source§impl Error for DeleteDirectConnectGatewayError
impl Error for DeleteDirectConnectGatewayError
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<DeleteDirectConnectGatewayError> for Error
impl From<DeleteDirectConnectGatewayError> for Error
source§fn from(err: DeleteDirectConnectGatewayError) -> Self
fn from(err: DeleteDirectConnectGatewayError) -> Self
Converts to this type from the input type.