Struct aws_sdk_memorydb::error::CreateParameterGroupError
source · #[non_exhaustive]pub struct CreateParameterGroupError {
pub kind: CreateParameterGroupErrorKind,
/* private fields */
}
Expand description
Error type for the CreateParameterGroup
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: CreateParameterGroupErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateParameterGroupError
impl CreateParameterGroupError
sourcepub fn new(kind: CreateParameterGroupErrorKind, meta: Error) -> Self
pub fn new(kind: CreateParameterGroupErrorKind, meta: Error) -> Self
Creates a new CreateParameterGroupError
.
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 CreateParameterGroupError::Unhandled
variant from any error type.
Examples found in repository?
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874
pub fn parse_create_parameter_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateParameterGroupOutput,
crate::error::CreateParameterGroupError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateParameterGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateParameterGroupError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterCombinationException" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::InvalidParameterCombinationException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_combination_exception::Builder::default(
);
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_combination_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidParameterGroupStateFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::InvalidParameterGroupStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_group_state_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_group_state_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::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::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ParameterGroupAlreadyExistsFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::ParameterGroupAlreadyExistsFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::parameter_group_already_exists_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_parameter_group_already_exists_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ParameterGroupQuotaExceededFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::ParameterGroupQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::parameter_group_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_parameter_group_quota_exceeded_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceLinkedRoleNotFoundFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::ServiceLinkedRoleNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_linked_role_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_linked_role_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TagQuotaPerResourceExceeded" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::TagQuotaPerResourceExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::tag_quota_per_resource_exceeded::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_tag_quota_per_resource_exceeded_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateParameterGroupError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateParameterGroupError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874
pub fn parse_create_parameter_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateParameterGroupOutput,
crate::error::CreateParameterGroupError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateParameterGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateParameterGroupError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterCombinationException" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::InvalidParameterCombinationException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_combination_exception::Builder::default(
);
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_combination_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidParameterGroupStateFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::InvalidParameterGroupStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_group_state_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_group_state_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::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::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ParameterGroupAlreadyExistsFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::ParameterGroupAlreadyExistsFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::parameter_group_already_exists_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_parameter_group_already_exists_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ParameterGroupQuotaExceededFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::ParameterGroupQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::parameter_group_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_parameter_group_quota_exceeded_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceLinkedRoleNotFoundFault" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::ServiceLinkedRoleNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_linked_role_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_linked_role_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TagQuotaPerResourceExceeded" => crate::error::CreateParameterGroupError {
meta: generic,
kind: crate::error::CreateParameterGroupErrorKind::TagQuotaPerResourceExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::tag_quota_per_resource_exceeded::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_tag_quota_per_resource_exceeded_json_err(response.body().as_ref(), output).map_err(crate::error::CreateParameterGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateParameterGroupError::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_parameter_combination_exception(&self) -> bool
pub fn is_invalid_parameter_combination_exception(&self) -> bool
Returns true
if the error kind is CreateParameterGroupErrorKind::InvalidParameterCombinationException
.
sourcepub fn is_invalid_parameter_group_state_fault(&self) -> bool
pub fn is_invalid_parameter_group_state_fault(&self) -> bool
Returns true
if the error kind is CreateParameterGroupErrorKind::InvalidParameterGroupStateFault
.
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 CreateParameterGroupErrorKind::InvalidParameterValueException
.
sourcepub fn is_parameter_group_already_exists_fault(&self) -> bool
pub fn is_parameter_group_already_exists_fault(&self) -> bool
Returns true
if the error kind is CreateParameterGroupErrorKind::ParameterGroupAlreadyExistsFault
.
sourcepub fn is_parameter_group_quota_exceeded_fault(&self) -> bool
pub fn is_parameter_group_quota_exceeded_fault(&self) -> bool
Returns true
if the error kind is CreateParameterGroupErrorKind::ParameterGroupQuotaExceededFault
.
sourcepub fn is_service_linked_role_not_found_fault(&self) -> bool
pub fn is_service_linked_role_not_found_fault(&self) -> bool
Returns true
if the error kind is CreateParameterGroupErrorKind::ServiceLinkedRoleNotFoundFault
.
sourcepub fn is_tag_quota_per_resource_exceeded(&self) -> bool
pub fn is_tag_quota_per_resource_exceeded(&self) -> bool
Returns true
if the error kind is CreateParameterGroupErrorKind::TagQuotaPerResourceExceeded
.