#[non_exhaustive]pub enum CreateKeyGroupError {
InvalidArgument(InvalidArgument),
KeyGroupAlreadyExists(KeyGroupAlreadyExists),
TooManyKeyGroups(TooManyKeyGroups),
TooManyPublicKeysInKeyGroup(TooManyPublicKeysInKeyGroup),
Unhandled(Unhandled),
}
Expand description
Error type for the CreateKeyGroupError
operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidArgument(InvalidArgument)
An argument is invalid.
KeyGroupAlreadyExists(KeyGroupAlreadyExists)
A key group with this name already exists. You must provide a unique name. To modify an existing key group, use UpdateKeyGroup
.
TooManyKeyGroups(TooManyKeyGroups)
You have reached the maximum number of key groups for this Amazon Web Services account. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
TooManyPublicKeysInKeyGroup(TooManyPublicKeysInKeyGroup)
The number of public keys in this key group is more than the maximum allowed. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
Unhandled(Unhandled)
Unhandled
directly is not forwards compatible. Instead, match using a variable wildcard pattern and check .code()
:
err if err.code() == Some("SpecificExceptionCode") => { /* handle the error */ }
See ProvideErrorMetadata
for what information is available for the error.An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
Implementations§
source§impl CreateKeyGroupError
impl CreateKeyGroupError
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 CreateKeyGroupError::Unhandled
variant from any error type.
sourcepub fn generic(err: ErrorMetadata) -> Self
pub fn generic(err: ErrorMetadata) -> Self
Creates the CreateKeyGroupError::Unhandled
variant from an ErrorMetadata
.
sourcepub fn meta(&self) -> &ErrorMetadata
pub fn meta(&self) -> &ErrorMetadata
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn is_invalid_argument(&self) -> bool
pub fn is_invalid_argument(&self) -> bool
Returns true
if the error kind is CreateKeyGroupError::InvalidArgument
.
sourcepub fn is_key_group_already_exists(&self) -> bool
pub fn is_key_group_already_exists(&self) -> bool
Returns true
if the error kind is CreateKeyGroupError::KeyGroupAlreadyExists
.
sourcepub fn is_too_many_key_groups(&self) -> bool
pub fn is_too_many_key_groups(&self) -> bool
Returns true
if the error kind is CreateKeyGroupError::TooManyKeyGroups
.
sourcepub fn is_too_many_public_keys_in_key_group(&self) -> bool
pub fn is_too_many_public_keys_in_key_group(&self) -> bool
Returns true
if the error kind is CreateKeyGroupError::TooManyPublicKeysInKeyGroup
.
Trait Implementations§
source§impl CreateUnhandledError for CreateKeyGroupError
impl CreateUnhandledError for CreateKeyGroupError
source§fn create_unhandled_error(
source: Box<dyn Error + Send + Sync + 'static>,
meta: Option<ErrorMetadata>
) -> Self
fn create_unhandled_error( source: Box<dyn Error + Send + Sync + 'static>, meta: Option<ErrorMetadata> ) -> Self
source
and error metadata.source§impl Debug for CreateKeyGroupError
impl Debug for CreateKeyGroupError
source§impl Display for CreateKeyGroupError
impl Display for CreateKeyGroupError
source§impl Error for CreateKeyGroupError
impl Error for CreateKeyGroupError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<CreateKeyGroupError> for Error
impl From<CreateKeyGroupError> for Error
source§fn from(err: CreateKeyGroupError) -> Self
fn from(err: CreateKeyGroupError) -> Self
source§impl ProvideErrorMetadata for CreateKeyGroupError
impl ProvideErrorMetadata for CreateKeyGroupError
source§fn meta(&self) -> &ErrorMetadata
fn meta(&self) -> &ErrorMetadata
source§impl RequestId for CreateKeyGroupError
impl RequestId for CreateKeyGroupError
source§fn request_id(&self) -> Option<&str>
fn request_id(&self) -> Option<&str>
None
if the service could not be reached.