#[non_exhaustive]pub struct CreateLoadBalancerError {
pub kind: CreateLoadBalancerErrorKind,
/* private fields */
}
Expand description
Error type for the CreateLoadBalancer
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: CreateLoadBalancerErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateLoadBalancerError
impl CreateLoadBalancerError
sourcepub fn new(kind: CreateLoadBalancerErrorKind, meta: Error) -> Self
pub fn new(kind: CreateLoadBalancerErrorKind, meta: Error) -> Self
Creates a new CreateLoadBalancerError
.
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 CreateLoadBalancerError::Unhandled
variant from any error type.
Examples found in repository?
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
pub fn parse_create_load_balancer_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateLoadBalancerOutput,
crate::error::CreateLoadBalancerError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateLoadBalancerError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateLoadBalancerError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CertificateNotFound" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::CertificateNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::certificate_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_certificate_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DuplicateLoadBalancerName" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::DuplicateAccessPointNameException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::duplicate_access_point_name_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_duplicate_access_point_name_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DuplicateTagKeys" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::DuplicateTagKeysException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::duplicate_tag_keys_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_duplicate_tag_keys_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidConfigurationRequest" => {
crate::error::CreateLoadBalancerError {
meta: generic,
kind:
crate::error::CreateLoadBalancerErrorKind::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::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
}
}
"InvalidScheme" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::InvalidSchemeException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_scheme_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_scheme_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidSecurityGroup" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::InvalidSecurityGroupException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_security_group_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_security_group_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidSubnet" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::InvalidSubnetException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_subnet_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_subnet_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OperationNotPermitted" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::OperationNotPermittedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::operation_not_permitted_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_operation_not_permitted_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetNotFound" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::SubnetNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_subnet_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyLoadBalancers" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::TooManyAccessPointsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::too_many_access_points_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_access_points_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyTags" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::TooManyTagsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_tags_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_tags_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedProtocol" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::UnsupportedProtocolException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unsupported_protocol_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_unsupported_protocol_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateLoadBalancerError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateLoadBalancerError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738
pub fn parse_create_load_balancer_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateLoadBalancerOutput,
crate::error::CreateLoadBalancerError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateLoadBalancerError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateLoadBalancerError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CertificateNotFound" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::CertificateNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::certificate_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_certificate_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DuplicateLoadBalancerName" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::DuplicateAccessPointNameException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::duplicate_access_point_name_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_duplicate_access_point_name_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DuplicateTagKeys" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::DuplicateTagKeysException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::duplicate_tag_keys_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_duplicate_tag_keys_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidConfigurationRequest" => {
crate::error::CreateLoadBalancerError {
meta: generic,
kind:
crate::error::CreateLoadBalancerErrorKind::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::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
}
}
"InvalidScheme" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::InvalidSchemeException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_scheme_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_scheme_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidSecurityGroup" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::InvalidSecurityGroupException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_security_group_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_security_group_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidSubnet" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::InvalidSubnetException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_subnet_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_subnet_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OperationNotPermitted" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::OperationNotPermittedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::operation_not_permitted_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_operation_not_permitted_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetNotFound" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::SubnetNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_subnet_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyLoadBalancers" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::TooManyAccessPointsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::too_many_access_points_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_access_points_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyTags" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::TooManyTagsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_tags_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_too_many_tags_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedProtocol" => crate::error::CreateLoadBalancerError {
meta: generic,
kind: crate::error::CreateLoadBalancerErrorKind::UnsupportedProtocolException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unsupported_protocol_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_unsupported_protocol_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateLoadBalancerError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateLoadBalancerError::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_certificate_not_found_exception(&self) -> bool
pub fn is_certificate_not_found_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::CertificateNotFoundException
.
sourcepub fn is_duplicate_access_point_name_exception(&self) -> bool
pub fn is_duplicate_access_point_name_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::DuplicateAccessPointNameException
.
sourcepub fn is_duplicate_tag_keys_exception(&self) -> bool
pub fn is_duplicate_tag_keys_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::DuplicateTagKeysException
.
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 CreateLoadBalancerErrorKind::InvalidConfigurationRequestException
.
sourcepub fn is_invalid_scheme_exception(&self) -> bool
pub fn is_invalid_scheme_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::InvalidSchemeException
.
sourcepub fn is_invalid_security_group_exception(&self) -> bool
pub fn is_invalid_security_group_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::InvalidSecurityGroupException
.
sourcepub fn is_invalid_subnet_exception(&self) -> bool
pub fn is_invalid_subnet_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::InvalidSubnetException
.
sourcepub fn is_operation_not_permitted_exception(&self) -> bool
pub fn is_operation_not_permitted_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::OperationNotPermittedException
.
sourcepub fn is_subnet_not_found_exception(&self) -> bool
pub fn is_subnet_not_found_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::SubnetNotFoundException
.
sourcepub fn is_too_many_access_points_exception(&self) -> bool
pub fn is_too_many_access_points_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::TooManyAccessPointsException
.
Returns true
if the error kind is CreateLoadBalancerErrorKind::TooManyTagsException
.
sourcepub fn is_unsupported_protocol_exception(&self) -> bool
pub fn is_unsupported_protocol_exception(&self) -> bool
Returns true
if the error kind is CreateLoadBalancerErrorKind::UnsupportedProtocolException
.