#[non_exhaustive]pub enum CreateDocumentError {
DocumentAlreadyExists(DocumentAlreadyExists),
DocumentLimitExceeded(DocumentLimitExceeded),
InternalServerError(InternalServerError),
InvalidDocumentContent(InvalidDocumentContent),
InvalidDocumentSchemaVersion(InvalidDocumentSchemaVersion),
MaxDocumentSizeExceeded(MaxDocumentSizeExceeded),
Unhandled(Unhandled),
}
Expand description
Error type for the CreateDocumentError
operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DocumentAlreadyExists(DocumentAlreadyExists)
The specified document already exists.
DocumentLimitExceeded(DocumentLimitExceeded)
You can have at most 500 active SSM documents.
InternalServerError(InternalServerError)
An error occurred on the server side.
InvalidDocumentContent(InvalidDocumentContent)
The content for the document isn't valid.
InvalidDocumentSchemaVersion(InvalidDocumentSchemaVersion)
The version of the document schema isn't supported.
MaxDocumentSizeExceeded(MaxDocumentSizeExceeded)
The size limit of a document is 64 KB.
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 CreateDocumentError
impl CreateDocumentError
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 CreateDocumentError::Unhandled
variant from any error type.
sourcepub fn generic(err: ErrorMetadata) -> Self
pub fn generic(err: ErrorMetadata) -> Self
Creates the CreateDocumentError::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_document_already_exists(&self) -> bool
pub fn is_document_already_exists(&self) -> bool
Returns true
if the error kind is CreateDocumentError::DocumentAlreadyExists
.
sourcepub fn is_document_limit_exceeded(&self) -> bool
pub fn is_document_limit_exceeded(&self) -> bool
Returns true
if the error kind is CreateDocumentError::DocumentLimitExceeded
.
sourcepub fn is_internal_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is CreateDocumentError::InternalServerError
.
sourcepub fn is_invalid_document_content(&self) -> bool
pub fn is_invalid_document_content(&self) -> bool
Returns true
if the error kind is CreateDocumentError::InvalidDocumentContent
.
sourcepub fn is_invalid_document_schema_version(&self) -> bool
pub fn is_invalid_document_schema_version(&self) -> bool
Returns true
if the error kind is CreateDocumentError::InvalidDocumentSchemaVersion
.
sourcepub fn is_max_document_size_exceeded(&self) -> bool
pub fn is_max_document_size_exceeded(&self) -> bool
Returns true
if the error kind is CreateDocumentError::MaxDocumentSizeExceeded
.
Trait Implementations§
source§impl CreateUnhandledError for CreateDocumentError
impl CreateUnhandledError for CreateDocumentError
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 CreateDocumentError
impl Debug for CreateDocumentError
source§impl Display for CreateDocumentError
impl Display for CreateDocumentError
source§impl Error for CreateDocumentError
impl Error for CreateDocumentError
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<CreateDocumentError> for Error
impl From<CreateDocumentError> for Error
source§fn from(err: CreateDocumentError) -> Self
fn from(err: CreateDocumentError) -> Self
source§impl ProvideErrorMetadata for CreateDocumentError
impl ProvideErrorMetadata for CreateDocumentError
source§fn meta(&self) -> &ErrorMetadata
fn meta(&self) -> &ErrorMetadata
source§impl RequestId for CreateDocumentError
impl RequestId for CreateDocumentError
source§fn request_id(&self) -> Option<&str>
fn request_id(&self) -> Option<&str>
None
if the service could not be reached.