#[non_exhaustive]pub enum CreateBucketError {
BucketAlreadyExists(BucketAlreadyExists),
BucketAlreadyOwnedByYou(BucketAlreadyOwnedByYou),
Unhandled(Unhandled),
}
Expand description
Error type for the CreateBucketError
operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BucketAlreadyExists(BucketAlreadyExists)
The requested bucket name is not available. The bucket namespace is shared by all users of the system. Select a different name and try again.
BucketAlreadyOwnedByYou(BucketAlreadyOwnedByYou)
The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all Amazon Web Services Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing bucket that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket access control lists (ACLs).
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 CreateBucketError
impl CreateBucketError
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 CreateBucketError::Unhandled
variant from any error type.
sourcepub fn generic(err: ErrorMetadata) -> Self
pub fn generic(err: ErrorMetadata) -> Self
Creates the CreateBucketError::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_bucket_already_exists(&self) -> bool
pub fn is_bucket_already_exists(&self) -> bool
Returns true
if the error kind is CreateBucketError::BucketAlreadyExists
.
sourcepub fn is_bucket_already_owned_by_you(&self) -> bool
pub fn is_bucket_already_owned_by_you(&self) -> bool
Returns true
if the error kind is CreateBucketError::BucketAlreadyOwnedByYou
.
Trait Implementations§
source§impl CreateUnhandledError for CreateBucketError
impl CreateUnhandledError for CreateBucketError
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 CreateBucketError
impl Debug for CreateBucketError
source§impl Display for CreateBucketError
impl Display for CreateBucketError
source§impl Error for CreateBucketError
impl Error for CreateBucketError
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<CreateBucketError> for Error
impl From<CreateBucketError> for Error
source§fn from(err: CreateBucketError) -> Self
fn from(err: CreateBucketError) -> Self
source§impl ProvideErrorKind for CreateBucketError
impl ProvideErrorKind for CreateBucketError
source§impl ProvideErrorMetadata for CreateBucketError
impl ProvideErrorMetadata for CreateBucketError
source§fn meta(&self) -> &ErrorMetadata
fn meta(&self) -> &ErrorMetadata
source§impl RequestId for CreateBucketError
impl RequestId for CreateBucketError
source§fn request_id(&self) -> Option<&str>
fn request_id(&self) -> Option<&str>
None
if the service could not be reached.