#[non_exhaustive]pub struct CreateAppCookieStickinessPolicyError {
pub kind: CreateAppCookieStickinessPolicyErrorKind,
/* private fields */
}
Expand description
Error type for the CreateAppCookieStickinessPolicy
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: CreateAppCookieStickinessPolicyErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateAppCookieStickinessPolicyError
impl CreateAppCookieStickinessPolicyError
sourcepub fn new(kind: CreateAppCookieStickinessPolicyErrorKind, meta: Error) -> Self
pub fn new(kind: CreateAppCookieStickinessPolicyErrorKind, meta: Error) -> Self
Creates a new CreateAppCookieStickinessPolicyError
.
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 CreateAppCookieStickinessPolicyError::Unhandled
variant from any error type.
Examples found in repository?
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
pub fn parse_create_app_cookie_stickiness_policy_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateAppCookieStickinessPolicyOutput,
crate::error::CreateAppCookieStickinessPolicyError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateAppCookieStickinessPolicyError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"LoadBalancerNotFound" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::AccessPointNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_point_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_point_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"DuplicatePolicyName" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::DuplicatePolicyNameException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::duplicate_policy_name_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_duplicate_policy_name_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidConfigurationRequest" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::InvalidConfigurationRequestException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_configuration_request_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_configuration_request_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyPolicies" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::TooManyPoliciesException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::too_many_policies_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_policies_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::CreateAppCookieStickinessPolicyError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateAppCookieStickinessPolicyError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
pub fn parse_create_app_cookie_stickiness_policy_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateAppCookieStickinessPolicyOutput,
crate::error::CreateAppCookieStickinessPolicyError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateAppCookieStickinessPolicyError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"LoadBalancerNotFound" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::AccessPointNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_point_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_point_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"DuplicatePolicyName" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::DuplicatePolicyNameException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::duplicate_policy_name_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_duplicate_policy_name_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidConfigurationRequest" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::InvalidConfigurationRequestException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_configuration_request_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_configuration_request_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyPolicies" => crate::error::CreateAppCookieStickinessPolicyError { meta: generic, kind: crate::error::CreateAppCookieStickinessPolicyErrorKind::TooManyPoliciesException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::too_many_policies_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_policies_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateAppCookieStickinessPolicyError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::CreateAppCookieStickinessPolicyError::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_point_not_found_exception(&self) -> bool
pub fn is_access_point_not_found_exception(&self) -> bool
Returns true
if the error kind is CreateAppCookieStickinessPolicyErrorKind::AccessPointNotFoundException
.
sourcepub fn is_duplicate_policy_name_exception(&self) -> bool
pub fn is_duplicate_policy_name_exception(&self) -> bool
Returns true
if the error kind is CreateAppCookieStickinessPolicyErrorKind::DuplicatePolicyNameException
.
sourcepub fn is_invalid_configuration_request_exception(&self) -> bool
pub fn is_invalid_configuration_request_exception(&self) -> bool
Returns true
if the error kind is CreateAppCookieStickinessPolicyErrorKind::InvalidConfigurationRequestException
.
sourcepub fn is_too_many_policies_exception(&self) -> bool
pub fn is_too_many_policies_exception(&self) -> bool
Returns true
if the error kind is CreateAppCookieStickinessPolicyErrorKind::TooManyPoliciesException
.