#[non_exhaustive]pub struct DescribeConformancePackStatusError {
pub kind: DescribeConformancePackStatusErrorKind,
/* private fields */
}Expand description
Error type for the DescribeConformancePackStatus 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: DescribeConformancePackStatusErrorKindKind of error that occurred.
Implementations§
source§impl DescribeConformancePackStatusError
impl DescribeConformancePackStatusError
sourcepub fn new(kind: DescribeConformancePackStatusErrorKind, meta: Error) -> Self
pub fn new(kind: DescribeConformancePackStatusErrorKind, meta: Error) -> Self
Creates a new DescribeConformancePackStatusError.
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 DescribeConformancePackStatusError::Unhandled variant from any error type.
Examples found in repository?
2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430
pub fn parse_describe_conformance_pack_status_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DescribeConformancePackStatusOutput,
crate::error::DescribeConformancePackStatusError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DescribeConformancePackStatusError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidLimitException" => crate::error::DescribeConformancePackStatusError {
meta: generic,
kind: crate::error::DescribeConformancePackStatusErrorKind::InvalidLimitException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidNextTokenException" => crate::error::DescribeConformancePackStatusError {
meta: generic,
kind: crate::error::DescribeConformancePackStatusErrorKind::InvalidNextTokenException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidParameterValueException" => crate::error::DescribeConformancePackStatusError {
meta: generic,
kind:
crate::error::DescribeConformancePackStatusErrorKind::InvalidParameterValueException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::DescribeConformancePackStatusError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DescribeConformancePackStatusError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430
pub fn parse_describe_conformance_pack_status_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DescribeConformancePackStatusOutput,
crate::error::DescribeConformancePackStatusError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DescribeConformancePackStatusError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidLimitException" => crate::error::DescribeConformancePackStatusError {
meta: generic,
kind: crate::error::DescribeConformancePackStatusErrorKind::InvalidLimitException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidNextTokenException" => crate::error::DescribeConformancePackStatusError {
meta: generic,
kind: crate::error::DescribeConformancePackStatusErrorKind::InvalidNextTokenException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidParameterValueException" => crate::error::DescribeConformancePackStatusError {
meta: generic,
kind:
crate::error::DescribeConformancePackStatusErrorKind::InvalidParameterValueException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeConformancePackStatusError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::DescribeConformancePackStatusError::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_invalid_limit_exception(&self) -> bool
pub fn is_invalid_limit_exception(&self) -> bool
Returns true if the error kind is DescribeConformancePackStatusErrorKind::InvalidLimitException.
sourcepub fn is_invalid_next_token_exception(&self) -> bool
pub fn is_invalid_next_token_exception(&self) -> bool
Returns true if the error kind is DescribeConformancePackStatusErrorKind::InvalidNextTokenException.
sourcepub fn is_invalid_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true if the error kind is DescribeConformancePackStatusErrorKind::InvalidParameterValueException.