Struct aws_sdk_kms::error::UpdatePrimaryRegionError
source · #[non_exhaustive]pub struct UpdatePrimaryRegionError {
pub kind: UpdatePrimaryRegionErrorKind,
/* private fields */
}
Expand description
Error type for the UpdatePrimaryRegion
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: UpdatePrimaryRegionErrorKind
Kind of error that occurred.
Implementations§
source§impl UpdatePrimaryRegionError
impl UpdatePrimaryRegionError
sourcepub fn new(kind: UpdatePrimaryRegionErrorKind, meta: Error) -> Self
pub fn new(kind: UpdatePrimaryRegionErrorKind, meta: Error) -> Self
Creates a new UpdatePrimaryRegionError
.
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 UpdatePrimaryRegionError::Unhandled
variant from any error type.
Examples found in repository?
6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915
pub fn parse_update_primary_region_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdatePrimaryRegionOutput,
crate::error::UpdatePrimaryRegionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdatePrimaryRegionError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DisabledException" => {
crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::DisabledException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::disabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_disabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidArnException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::InvalidArnException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_arn_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_arn_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInternalException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::KmsInternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInvalidStateException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::KmsInvalidStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_invalid_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_invalid_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedOperationException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::UnsupportedOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unsupported_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdatePrimaryRegionError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdatePrimaryRegionError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915
pub fn parse_update_primary_region_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdatePrimaryRegionOutput,
crate::error::UpdatePrimaryRegionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdatePrimaryRegionError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DisabledException" => {
crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::DisabledException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::disabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_disabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidArnException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::InvalidArnException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_arn_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_arn_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInternalException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::KmsInternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInvalidStateException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::KmsInvalidStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_invalid_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_invalid_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedOperationException" => crate::error::UpdatePrimaryRegionError {
meta: generic,
kind: crate::error::UpdatePrimaryRegionErrorKind::UnsupportedOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unsupported_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdatePrimaryRegionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdatePrimaryRegionError::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_disabled_exception(&self) -> bool
pub fn is_disabled_exception(&self) -> bool
Returns true
if the error kind is UpdatePrimaryRegionErrorKind::DisabledException
.
sourcepub fn is_invalid_arn_exception(&self) -> bool
pub fn is_invalid_arn_exception(&self) -> bool
Returns true
if the error kind is UpdatePrimaryRegionErrorKind::InvalidArnException
.
sourcepub fn is_kms_internal_exception(&self) -> bool
pub fn is_kms_internal_exception(&self) -> bool
Returns true
if the error kind is UpdatePrimaryRegionErrorKind::KmsInternalException
.
sourcepub fn is_kms_invalid_state_exception(&self) -> bool
pub fn is_kms_invalid_state_exception(&self) -> bool
Returns true
if the error kind is UpdatePrimaryRegionErrorKind::KmsInvalidStateException
.
sourcepub fn is_not_found_exception(&self) -> bool
pub fn is_not_found_exception(&self) -> bool
Returns true
if the error kind is UpdatePrimaryRegionErrorKind::NotFoundException
.
sourcepub fn is_unsupported_operation_exception(&self) -> bool
pub fn is_unsupported_operation_exception(&self) -> bool
Returns true
if the error kind is UpdatePrimaryRegionErrorKind::UnsupportedOperationException
.