#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
AccessDeniedException(crate::types::error::AccessDeniedException),
ConflictException(crate::types::error::ConflictException),
InternalServerException(crate::types::error::InternalServerException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
ValidationException(crate::types::error::ValidationException),
Unhandled(aws_smithy_types::error::Unhandled),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::AccessDeniedException(inner) => inner.fmt(f),
Error::ConflictException(inner) => inner.fmt(f),
Error::InternalServerException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
Error::ValidationException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::create_keyspace::CreateKeyspaceError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::create_keyspace::CreateKeyspaceError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::create_keyspace::CreateKeyspaceError> for Error {
fn from(err: crate::operation::create_keyspace::CreateKeyspaceError) -> Self {
match err {
crate::operation::create_keyspace::CreateKeyspaceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::create_keyspace::CreateKeyspaceError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::create_keyspace::CreateKeyspaceError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::create_keyspace::CreateKeyspaceError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
crate::operation::create_keyspace::CreateKeyspaceError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::create_keyspace::CreateKeyspaceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::create_table::CreateTableError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::create_table::CreateTableError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::create_table::CreateTableError> for Error {
fn from(err: crate::operation::create_table::CreateTableError) -> Self {
match err {
crate::operation::create_table::CreateTableError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::create_table::CreateTableError::ConflictException(inner) => {
Error::ConflictException(inner)
}
crate::operation::create_table::CreateTableError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::create_table::CreateTableError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::create_table::CreateTableError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::create_table::CreateTableError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::create_table::CreateTableError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::delete_keyspace::DeleteKeyspaceError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::delete_keyspace::DeleteKeyspaceError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_keyspace::DeleteKeyspaceError> for Error {
fn from(err: crate::operation::delete_keyspace::DeleteKeyspaceError) -> Self {
match err {
crate::operation::delete_keyspace::DeleteKeyspaceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::delete_keyspace::DeleteKeyspaceError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::delete_keyspace::DeleteKeyspaceError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::delete_keyspace::DeleteKeyspaceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::delete_keyspace::DeleteKeyspaceError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
crate::operation::delete_keyspace::DeleteKeyspaceError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::delete_keyspace::DeleteKeyspaceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::delete_table::DeleteTableError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::delete_table::DeleteTableError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_table::DeleteTableError> for Error {
fn from(err: crate::operation::delete_table::DeleteTableError) -> Self {
match err {
crate::operation::delete_table::DeleteTableError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::delete_table::DeleteTableError::ConflictException(inner) => {
Error::ConflictException(inner)
}
crate::operation::delete_table::DeleteTableError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::delete_table::DeleteTableError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::delete_table::DeleteTableError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::delete_table::DeleteTableError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::delete_table::DeleteTableError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::get_keyspace::GetKeyspaceError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::get_keyspace::GetKeyspaceError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::get_keyspace::GetKeyspaceError> for Error {
fn from(err: crate::operation::get_keyspace::GetKeyspaceError) -> Self {
match err {
crate::operation::get_keyspace::GetKeyspaceError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::get_keyspace::GetKeyspaceError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::get_keyspace::GetKeyspaceError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::get_keyspace::GetKeyspaceError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::get_keyspace::GetKeyspaceError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::get_keyspace::GetKeyspaceError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::get_table::GetTableError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::get_table::GetTableError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::get_table::GetTableError> for Error {
fn from(err: crate::operation::get_table::GetTableError) -> Self {
match err {
crate::operation::get_table::GetTableError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::get_table::GetTableError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::get_table::GetTableError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::get_table::GetTableError::ServiceQuotaExceededException(inner) => {
Error::ServiceQuotaExceededException(inner)
}
crate::operation::get_table::GetTableError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::get_table::GetTableError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::list_keyspaces::ListKeyspacesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::list_keyspaces::ListKeyspacesError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::list_keyspaces::ListKeyspacesError> for Error {
fn from(err: crate::operation::list_keyspaces::ListKeyspacesError) -> Self {
match err {
crate::operation::list_keyspaces::ListKeyspacesError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::list_keyspaces::ListKeyspacesError::InternalServerException(
inner,
) => Error::InternalServerException(inner),
crate::operation::list_keyspaces::ListKeyspacesError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::list_keyspaces::ListKeyspacesError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::list_keyspaces::ListKeyspacesError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::list_keyspaces::ListKeyspacesError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::list_tables::ListTablesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::list_tables::ListTablesError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::list_tables::ListTablesError> for Error {
fn from(err: crate::operation::list_tables::ListTablesError) -> Self {
match err {
crate::operation::list_tables::ListTablesError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::list_tables::ListTablesError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_tables::ListTablesError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::list_tables::ListTablesError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::list_tables::ListTablesError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::list_tables::ListTablesError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::list_tags_for_resource::ListTagsForResourceError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::list_tags_for_resource::ListTagsForResourceError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
match err {
crate::operation::list_tags_for_resource::ListTagsForResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::restore_table::RestoreTableError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::restore_table::RestoreTableError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::restore_table::RestoreTableError> for Error {
fn from(err: crate::operation::restore_table::RestoreTableError) -> Self {
match err {
crate::operation::restore_table::RestoreTableError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::restore_table::RestoreTableError::ConflictException(inner) => {
Error::ConflictException(inner)
}
crate::operation::restore_table::RestoreTableError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::restore_table::RestoreTableError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::restore_table::RestoreTableError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::restore_table::RestoreTableError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::restore_table::RestoreTableError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::tag_resource::TagResourceError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::tag_resource::TagResourceError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::tag_resource::TagResourceError> for Error {
fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
match err {
crate::operation::tag_resource::TagResourceError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::tag_resource::TagResourceError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::tag_resource::TagResourceError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::tag_resource::TagResourceError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::untag_resource::UntagResourceError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::untag_resource::UntagResourceError> for Error {
fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
match err {
crate::operation::untag_resource::UntagResourceError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::untag_resource::UntagResourceError::ConflictException(inner) => {
Error::ConflictException(inner)
}
crate::operation::untag_resource::UntagResourceError::InternalServerException(
inner,
) => Error::InternalServerException(inner),
crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::untag_resource::UntagResourceError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::update_table::UpdateTableError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::update_table::UpdateTableError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::update_table::UpdateTableError> for Error {
fn from(err: crate::operation::update_table::UpdateTableError) -> Self {
match err {
crate::operation::update_table::UpdateTableError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::update_table::UpdateTableError::ConflictException(inner) => {
Error::ConflictException(inner)
}
crate::operation::update_table::UpdateTableError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::update_table::UpdateTableError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::update_table::UpdateTableError::ServiceQuotaExceededException(
inner,
) => Error::ServiceQuotaExceededException(inner),
crate::operation::update_table::UpdateTableError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::update_table::UpdateTableError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl std::error::Error for Error {
fn source(&self) -> std::option::Option<&(dyn std::error::Error + 'static)> {
match self {
Error::AccessDeniedException(inner) => inner.source(),
Error::ConflictException(inner) => inner.source(),
Error::InternalServerException(inner) => inner.source(),
Error::ResourceNotFoundException(inner) => inner.source(),
Error::ServiceQuotaExceededException(inner) => inner.source(),
Error::ValidationException(inner) => inner.source(),
Error::Unhandled(inner) => inner.source(),
}
}
}
impl aws_http::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::AccessDeniedException(e) => e.request_id(),
Self::ConflictException(e) => e.request_id(),
Self::InternalServerException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::ServiceQuotaExceededException(e) => e.request_id(),
Self::ValidationException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}