#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
InvalidNextTokenException(crate::types::error::InvalidNextTokenException),
InvalidStateException(crate::types::error::InvalidStateException),
LimitExceededException(crate::types::error::LimitExceededException),
ResourceAlreadyExistsException(crate::types::error::ResourceAlreadyExistsException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ValidationException(crate::types::error::ValidationException),
#[deprecated(note = "Matching `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`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl ::std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::InvalidNextTokenException(inner) => inner.fmt(f),
Error::InvalidStateException(inner) => inner.fmt(f),
Error::LimitExceededException(inner) => inner.fmt(f),
Error::ResourceAlreadyExistsException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ValidationException(inner) => inner.fmt(f),
Error::Unhandled(_) => {
if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
write!(f, "unhandled error ({code})")
} else {
f.write_str("unhandled error")
}
}
}
}
}
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: value.into(),
meta: ::std::default::Default::default(),
})
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
match self {
Self::InvalidNextTokenException(inner) => inner.meta(),
Self::InvalidStateException(inner) => inner.meta(),
Self::LimitExceededException(inner) => inner.meta(),
Self::ResourceAlreadyExistsException(inner) => inner.meta(),
Self::ResourceNotFoundException(inner) => inner.meta(),
Self::ValidationException(inner) => inner.meta(),
Self::Unhandled(inner) => &inner.meta,
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_node::AssociateNodeError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_node::AssociateNodeError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::associate_node::AssociateNodeError> for Error {
fn from(err: crate::operation::associate_node::AssociateNodeError) -> Self {
match err {
crate::operation::associate_node::AssociateNodeError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::associate_node::AssociateNodeError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::associate_node::AssociateNodeError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::associate_node::AssociateNodeError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_backup::CreateBackupError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_backup::CreateBackupError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::create_backup::CreateBackupError> for Error {
fn from(err: crate::operation::create_backup::CreateBackupError) -> Self {
match err {
crate::operation::create_backup::CreateBackupError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::create_backup::CreateBackupError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::create_backup::CreateBackupError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::create_backup::CreateBackupError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::create_backup::CreateBackupError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_server::CreateServerError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_server::CreateServerError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::create_server::CreateServerError> for Error {
fn from(err: crate::operation::create_server::CreateServerError) -> Self {
match err {
crate::operation::create_server::CreateServerError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::create_server::CreateServerError::ResourceAlreadyExistsException(inner) => Error::ResourceAlreadyExistsException(inner),
crate::operation::create_server::CreateServerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::create_server::CreateServerError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::create_server::CreateServerError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_backup::DeleteBackupError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_backup::DeleteBackupError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::delete_backup::DeleteBackupError> for Error {
fn from(err: crate::operation::delete_backup::DeleteBackupError) -> Self {
match err {
crate::operation::delete_backup::DeleteBackupError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::delete_backup::DeleteBackupError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::delete_backup::DeleteBackupError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::delete_backup::DeleteBackupError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_server::DeleteServerError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_server::DeleteServerError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::delete_server::DeleteServerError> for Error {
fn from(err: crate::operation::delete_server::DeleteServerError) -> Self {
match err {
crate::operation::delete_server::DeleteServerError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::delete_server::DeleteServerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::delete_server::DeleteServerError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::delete_server::DeleteServerError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_account_attributes::DescribeAccountAttributesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_account_attributes::DescribeAccountAttributesError, R>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_account_attributes::DescribeAccountAttributesError> for Error {
fn from(err: crate::operation::describe_account_attributes::DescribeAccountAttributesError) -> Self {
match err {
crate::operation::describe_account_attributes::DescribeAccountAttributesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_backups::DescribeBackupsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_backups::DescribeBackupsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_backups::DescribeBackupsError> for Error {
fn from(err: crate::operation::describe_backups::DescribeBackupsError) -> Self {
match err {
crate::operation::describe_backups::DescribeBackupsError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
crate::operation::describe_backups::DescribeBackupsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::describe_backups::DescribeBackupsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::describe_backups::DescribeBackupsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_events::DescribeEventsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_events::DescribeEventsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_events::DescribeEventsError> for Error {
fn from(err: crate::operation::describe_events::DescribeEventsError) -> Self {
match err {
crate::operation::describe_events::DescribeEventsError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
crate::operation::describe_events::DescribeEventsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::describe_events::DescribeEventsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::describe_events::DescribeEventsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_node_association_status::DescribeNodeAssociationStatusError, R>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_node_association_status::DescribeNodeAssociationStatusError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_node_association_status::DescribeNodeAssociationStatusError> for Error {
fn from(err: crate::operation::describe_node_association_status::DescribeNodeAssociationStatusError) -> Self {
match err {
crate::operation::describe_node_association_status::DescribeNodeAssociationStatusError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::describe_node_association_status::DescribeNodeAssociationStatusError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::describe_node_association_status::DescribeNodeAssociationStatusError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_servers::DescribeServersError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_servers::DescribeServersError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_servers::DescribeServersError> for Error {
fn from(err: crate::operation::describe_servers::DescribeServersError) -> Self {
match err {
crate::operation::describe_servers::DescribeServersError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
crate::operation::describe_servers::DescribeServersError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::describe_servers::DescribeServersError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::describe_servers::DescribeServersError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_node::DisassociateNodeError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_node::DisassociateNodeError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::disassociate_node::DisassociateNodeError> for Error {
fn from(err: crate::operation::disassociate_node::DisassociateNodeError) -> Self {
match err {
crate::operation::disassociate_node::DisassociateNodeError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::disassociate_node::DisassociateNodeError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::disassociate_node::DisassociateNodeError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::disassociate_node::DisassociateNodeError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError> for Error {
fn from(err: crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError) -> Self {
match err {
crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError::InvalidStateException(inner) => {
Error::InvalidStateException(inner)
}
crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::export_server_engine_attribute::ExportServerEngineAttributeError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::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_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
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::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(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_runtime_api::client::result::SdkError<crate::operation::restore_server::RestoreServerError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::restore_server::RestoreServerError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::restore_server::RestoreServerError> for Error {
fn from(err: crate::operation::restore_server::RestoreServerError) -> Self {
match err {
crate::operation::restore_server::RestoreServerError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::restore_server::RestoreServerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::restore_server::RestoreServerError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::restore_server::RestoreServerError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_maintenance::StartMaintenanceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_maintenance::StartMaintenanceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::start_maintenance::StartMaintenanceError> for Error {
fn from(err: crate::operation::start_maintenance::StartMaintenanceError) -> Self {
match err {
crate::operation::start_maintenance::StartMaintenanceError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::start_maintenance::StartMaintenanceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::start_maintenance::StartMaintenanceError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::start_maintenance::StartMaintenanceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
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::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(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_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
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::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(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_runtime_api::client::result::SdkError<crate::operation::update_server::UpdateServerError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_server::UpdateServerError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::update_server::UpdateServerError> for Error {
fn from(err: crate::operation::update_server::UpdateServerError) -> Self {
match err {
crate::operation::update_server::UpdateServerError::InvalidStateException(inner) => Error::InvalidStateException(inner),
crate::operation::update_server::UpdateServerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::update_server::UpdateServerError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::update_server::UpdateServerError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError> for Error {
fn from(err: crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError) -> Self {
match err {
crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError::InvalidStateException(inner) => {
Error::InvalidStateException(inner)
}
crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::update_server_engine_attributes::UpdateServerEngineAttributesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<O, E> ::std::convert::From<::aws_smithy_runtime_api::client::waiters::error::WaiterError<O, E>> for Error
where
O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
E: ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::waiters::error::WaiterError<O, E>) -> Self {
Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::std::default::Default::default(),
source: err.into(),
})
}
}
impl ::std::error::Error for Error {
fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Error::InvalidNextTokenException(inner) => inner.source(),
Error::InvalidStateException(inner) => inner.source(),
Error::LimitExceededException(inner) => inner.source(),
Error::ResourceAlreadyExistsException(inner) => inner.source(),
Error::ResourceNotFoundException(inner) => inner.source(),
Error::ValidationException(inner) => inner.source(),
Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
}
}
}
impl ::aws_types::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::InvalidNextTokenException(e) => e.request_id(),
Self::InvalidStateException(e) => e.request_id(),
Self::LimitExceededException(e) => e.request_id(),
Self::ResourceAlreadyExistsException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::ValidationException(e) => e.request_id(),
Self::Unhandled(e) => e.meta.request_id(),
}
}
}