#[non_exhaustive]pub struct EnableProactiveEngagementError {
pub kind: EnableProactiveEngagementErrorKind,
/* private fields */
}
Expand description
Error type for the EnableProactiveEngagement
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: EnableProactiveEngagementErrorKind
Kind of error that occurred.
Implementations§
source§impl EnableProactiveEngagementError
impl EnableProactiveEngagementError
sourcepub fn new(kind: EnableProactiveEngagementErrorKind, meta: Error) -> Self
pub fn new(kind: EnableProactiveEngagementErrorKind, meta: Error) -> Self
Creates a new EnableProactiveEngagementError
.
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 EnableProactiveEngagementError::Unhandled
variant from any error type.
Examples found in repository?
2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 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 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553
pub fn parse_enable_proactive_engagement_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::EnableProactiveEngagementOutput,
crate::error::EnableProactiveEngagementError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::EnableProactiveEngagementError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalErrorException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::InternalErrorException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidOperationException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::InvalidOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::InvalidParameterException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OptimisticLockException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::OptimisticLockException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::optimistic_lock_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_optimistic_lock_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::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::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::EnableProactiveEngagementError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the EnableProactiveEngagementError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 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 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553
pub fn parse_enable_proactive_engagement_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::EnableProactiveEngagementOutput,
crate::error::EnableProactiveEngagementError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::EnableProactiveEngagementError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalErrorException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::InternalErrorException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidOperationException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::InvalidOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::InvalidParameterException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OptimisticLockException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::OptimisticLockException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::optimistic_lock_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_optimistic_lock_exception_json_err(response.body().as_ref(), output).map_err(crate::error::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::EnableProactiveEngagementError {
meta: generic,
kind: crate::error::EnableProactiveEngagementErrorKind::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::EnableProactiveEngagementError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::EnableProactiveEngagementError::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_internal_error_exception(&self) -> bool
pub fn is_internal_error_exception(&self) -> bool
Returns true
if the error kind is EnableProactiveEngagementErrorKind::InternalErrorException
.
sourcepub fn is_invalid_operation_exception(&self) -> bool
pub fn is_invalid_operation_exception(&self) -> bool
Returns true
if the error kind is EnableProactiveEngagementErrorKind::InvalidOperationException
.
sourcepub fn is_invalid_parameter_exception(&self) -> bool
pub fn is_invalid_parameter_exception(&self) -> bool
Returns true
if the error kind is EnableProactiveEngagementErrorKind::InvalidParameterException
.
sourcepub fn is_optimistic_lock_exception(&self) -> bool
pub fn is_optimistic_lock_exception(&self) -> bool
Returns true
if the error kind is EnableProactiveEngagementErrorKind::OptimisticLockException
.
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 EnableProactiveEngagementErrorKind::ResourceNotFoundException
.