aws-sdk-pipes 1.97.0

AWS SDK for Amazon EventBridge Pipes
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// All possible error types for this service.
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
    /// <p>An action you attempted resulted in an exception.</p>
    ConflictException(crate::types::error::ConflictException),
    /// <p>This exception occurs due to unexpected causes.</p>
    InternalException(crate::types::error::InternalException),
    /// <p>An entity that you specified does not exist.</p>
    NotFoundException(crate::types::error::NotFoundException),
    /// <p>A quota has been exceeded.</p>
    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
    /// <p>An action was throttled.</p>
    ThrottlingException(crate::types::error::ThrottlingException),
    /// <p>Indicates that an error has occurred while performing a validate operation.</p>
    ValidationException(crate::types::error::ValidationException),
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
    variable wildcard pattern and check `.code()`:
     \
    &nbsp;&nbsp;&nbsp;`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::ConflictException(inner) => inner.fmt(f),
            Error::InternalException(inner) => inner.fmt(f),
            Error::NotFoundException(inner) => inner.fmt(f),
            Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
            Error::ThrottlingException(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::ConflictException(inner) => inner.meta(),
            Self::InternalException(inner) => inner.meta(),
            Self::NotFoundException(inner) => inner.meta(),
            Self::ServiceQuotaExceededException(inner) => inner.meta(),
            Self::ThrottlingException(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::create_pipe::CreatePipeError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_pipe::CreatePipeError, 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_pipe::CreatePipeError> for Error {
    fn from(err: crate::operation::create_pipe::CreatePipeError) -> Self {
        match err {
            crate::operation::create_pipe::CreatePipeError::ConflictException(inner) => Error::ConflictException(inner),
            crate::operation::create_pipe::CreatePipeError::InternalException(inner) => Error::InternalException(inner),
            crate::operation::create_pipe::CreatePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::create_pipe::CreatePipeError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
            crate::operation::create_pipe::CreatePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::create_pipe::CreatePipeError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::create_pipe::CreatePipeError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_pipe::DeletePipeError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_pipe::DeletePipeError, 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_pipe::DeletePipeError> for Error {
    fn from(err: crate::operation::delete_pipe::DeletePipeError) -> Self {
        match err {
            crate::operation::delete_pipe::DeletePipeError::ConflictException(inner) => Error::ConflictException(inner),
            crate::operation::delete_pipe::DeletePipeError::InternalException(inner) => Error::InternalException(inner),
            crate::operation::delete_pipe::DeletePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::delete_pipe::DeletePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::delete_pipe::DeletePipeError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::delete_pipe::DeletePipeError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_pipe::DescribePipeError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_pipe::DescribePipeError, 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_pipe::DescribePipeError> for Error {
    fn from(err: crate::operation::describe_pipe::DescribePipeError) -> Self {
        match err {
            crate::operation::describe_pipe::DescribePipeError::InternalException(inner) => Error::InternalException(inner),
            crate::operation::describe_pipe::DescribePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::describe_pipe::DescribePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::describe_pipe::DescribePipeError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::describe_pipe::DescribePipeError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_pipes::ListPipesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_pipes::ListPipesError, 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_pipes::ListPipesError> for Error {
    fn from(err: crate::operation::list_pipes::ListPipesError) -> Self {
        match err {
            crate::operation::list_pipes::ListPipesError::InternalException(inner) => Error::InternalException(inner),
            crate::operation::list_pipes::ListPipesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::list_pipes::ListPipesError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::list_pipes::ListPipesError::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::InternalException(inner) => Error::InternalException(inner),
            crate::operation::list_tags_for_resource::ListTagsForResourceError::NotFoundException(inner) => Error::NotFoundException(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::start_pipe::StartPipeError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_pipe::StartPipeError, 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_pipe::StartPipeError> for Error {
    fn from(err: crate::operation::start_pipe::StartPipeError) -> Self {
        match err {
            crate::operation::start_pipe::StartPipeError::ConflictException(inner) => Error::ConflictException(inner),
            crate::operation::start_pipe::StartPipeError::InternalException(inner) => Error::InternalException(inner),
            crate::operation::start_pipe::StartPipeError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::start_pipe::StartPipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::start_pipe::StartPipeError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::start_pipe::StartPipeError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_pipe::StopPipeError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_pipe::StopPipeError, 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::stop_pipe::StopPipeError> for Error {
    fn from(err: crate::operation::stop_pipe::StopPipeError) -> Self {
        match err {
            crate::operation::stop_pipe::StopPipeError::ConflictException(inner) => Error::ConflictException(inner),
            crate::operation::stop_pipe::StopPipeError::InternalException(inner) => Error::InternalException(inner),
            crate::operation::stop_pipe::StopPipeError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::stop_pipe::StopPipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::stop_pipe::StopPipeError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::stop_pipe::StopPipeError::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::InternalException(inner) => Error::InternalException(inner),
            crate::operation::tag_resource::TagResourceError::NotFoundException(inner) => Error::NotFoundException(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::InternalException(inner) => Error::InternalException(inner),
            crate::operation::untag_resource::UntagResourceError::NotFoundException(inner) => Error::NotFoundException(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_pipe::UpdatePipeError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_pipe::UpdatePipeError, 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_pipe::UpdatePipeError> for Error {
    fn from(err: crate::operation::update_pipe::UpdatePipeError) -> Self {
        match err {
            crate::operation::update_pipe::UpdatePipeError::ConflictException(inner) => Error::ConflictException(inner),
            crate::operation::update_pipe::UpdatePipeError::InternalException(inner) => Error::InternalException(inner),
            crate::operation::update_pipe::UpdatePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::update_pipe::UpdatePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::update_pipe::UpdatePipeError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::update_pipe::UpdatePipeError::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::ConflictException(inner) => inner.source(),
            Error::InternalException(inner) => inner.source(),
            Error::NotFoundException(inner) => inner.source(),
            Error::ServiceQuotaExceededException(inner) => inner.source(),
            Error::ThrottlingException(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::ConflictException(e) => e.request_id(),
            Self::InternalException(e) => e.request_id(),
            Self::NotFoundException(e) => e.request_id(),
            Self::ServiceQuotaExceededException(e) => e.request_id(),
            Self::ThrottlingException(e) => e.request_id(),
            Self::ValidationException(e) => e.request_id(),
            Self::Unhandled(e) => e.meta.request_id(),
        }
    }
}