Struct aws_sdk_kms::error::GetPublicKeyError
source · #[non_exhaustive]pub struct GetPublicKeyError {
pub kind: GetPublicKeyErrorKind,
/* private fields */
}
Expand description
Error type for the GetPublicKey
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: GetPublicKeyErrorKind
Kind of error that occurred.
Implementations§
source§impl GetPublicKeyError
impl GetPublicKeyError
sourcepub fn new(kind: GetPublicKeyErrorKind, meta: Error) -> Self
pub fn new(kind: GetPublicKeyErrorKind, meta: Error) -> Self
Creates a new GetPublicKeyError
.
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 GetPublicKeyError::Unhandled
variant from any error type.
Examples found in repository?
3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065
pub fn parse_get_public_key_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetPublicKeyOutput, crate::error::GetPublicKeyError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetPublicKeyError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetPublicKeyError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DependencyTimeoutException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::DependencyTimeoutException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::dependency_timeout_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_dependency_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DisabledException" => {
crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidArnException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidGrantTokenException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::InvalidGrantTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_grant_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_grant_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidKeyUsageException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::InvalidKeyUsageException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_key_usage_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_key_usage_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KeyUnavailableException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::KeyUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::key_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_key_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInternalException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInvalidStateException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedOperationException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetPublicKeyError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetPublicKeyError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065
pub fn parse_get_public_key_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetPublicKeyOutput, crate::error::GetPublicKeyError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetPublicKeyError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetPublicKeyError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DependencyTimeoutException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::DependencyTimeoutException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::dependency_timeout_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_dependency_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"DisabledException" => {
crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidArnException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidGrantTokenException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::InvalidGrantTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_grant_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_grant_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidKeyUsageException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::InvalidKeyUsageException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_key_usage_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_key_usage_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KeyUnavailableException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::KeyUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::key_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_key_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInternalException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInvalidStateException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedOperationException" => crate::error::GetPublicKeyError {
meta: generic,
kind: crate::error::GetPublicKeyErrorKind::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::GetPublicKeyError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetPublicKeyError::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_dependency_timeout_exception(&self) -> bool
pub fn is_dependency_timeout_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::DependencyTimeoutException
.
sourcepub fn is_disabled_exception(&self) -> bool
pub fn is_disabled_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::DisabledException
.
sourcepub fn is_invalid_arn_exception(&self) -> bool
pub fn is_invalid_arn_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::InvalidArnException
.
sourcepub fn is_invalid_grant_token_exception(&self) -> bool
pub fn is_invalid_grant_token_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::InvalidGrantTokenException
.
sourcepub fn is_invalid_key_usage_exception(&self) -> bool
pub fn is_invalid_key_usage_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::InvalidKeyUsageException
.
Returns true
if the error kind is GetPublicKeyErrorKind::KeyUnavailableException
.
sourcepub fn is_kms_internal_exception(&self) -> bool
pub fn is_kms_internal_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::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 GetPublicKeyErrorKind::KmsInvalidStateException
.
sourcepub fn is_not_found_exception(&self) -> bool
pub fn is_not_found_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::NotFoundException
.
sourcepub fn is_unsupported_operation_exception(&self) -> bool
pub fn is_unsupported_operation_exception(&self) -> bool
Returns true
if the error kind is GetPublicKeyErrorKind::UnsupportedOperationException
.