#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
ConcurrentModificationException(crate::types::error::ConcurrentModificationException),
InvalidArgumentException(crate::types::error::InvalidArgumentException),
InvalidKmsResourceException(crate::types::error::InvalidKmsResourceException),
InvalidSourceException(crate::types::error::InvalidSourceException),
LimitExceededException(crate::types::error::LimitExceededException),
ResourceInUseException(crate::types::error::ResourceInUseException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
#[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::ConcurrentModificationException(inner) => inner.fmt(f),
Error::InvalidArgumentException(inner) => inner.fmt(f),
Error::InvalidKmsResourceException(inner) => inner.fmt(f),
Error::InvalidSourceException(inner) => inner.fmt(f),
Error::LimitExceededException(inner) => inner.fmt(f),
Error::ResourceInUseException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ServiceUnavailableException(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::ConcurrentModificationException(inner) => inner.meta(),
Self::InvalidArgumentException(inner) => inner.meta(),
Self::InvalidKmsResourceException(inner) => inner.meta(),
Self::InvalidSourceException(inner) => inner.meta(),
Self::LimitExceededException(inner) => inner.meta(),
Self::ResourceInUseException(inner) => inner.meta(),
Self::ResourceNotFoundException(inner) => inner.meta(),
Self::ServiceUnavailableException(inner) => inner.meta(),
Self::Unhandled(inner) => &inner.meta,
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_delivery_stream::CreateDeliveryStreamError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_delivery_stream::CreateDeliveryStreamError, 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_delivery_stream::CreateDeliveryStreamError> for Error {
fn from(err: crate::operation::create_delivery_stream::CreateDeliveryStreamError) -> Self {
match err {
crate::operation::create_delivery_stream::CreateDeliveryStreamError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::create_delivery_stream::CreateDeliveryStreamError::InvalidKmsResourceException(inner) => {
Error::InvalidKmsResourceException(inner)
}
crate::operation::create_delivery_stream::CreateDeliveryStreamError::LimitExceededException(inner) => {
Error::LimitExceededException(inner)
}
crate::operation::create_delivery_stream::CreateDeliveryStreamError::ResourceInUseException(inner) => {
Error::ResourceInUseException(inner)
}
crate::operation::create_delivery_stream::CreateDeliveryStreamError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_delivery_stream::DeleteDeliveryStreamError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_delivery_stream::DeleteDeliveryStreamError, 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_delivery_stream::DeleteDeliveryStreamError> for Error {
fn from(err: crate::operation::delete_delivery_stream::DeleteDeliveryStreamError) -> Self {
match err {
crate::operation::delete_delivery_stream::DeleteDeliveryStreamError::ResourceInUseException(inner) => {
Error::ResourceInUseException(inner)
}
crate::operation::delete_delivery_stream::DeleteDeliveryStreamError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::delete_delivery_stream::DeleteDeliveryStreamError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_delivery_stream::DescribeDeliveryStreamError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_delivery_stream::DescribeDeliveryStreamError, 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_delivery_stream::DescribeDeliveryStreamError> for Error {
fn from(err: crate::operation::describe_delivery_stream::DescribeDeliveryStreamError) -> Self {
match err {
crate::operation::describe_delivery_stream::DescribeDeliveryStreamError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::describe_delivery_stream::DescribeDeliveryStreamError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_delivery_streams::ListDeliveryStreamsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_delivery_streams::ListDeliveryStreamsError, 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_delivery_streams::ListDeliveryStreamsError> for Error {
fn from(err: crate::operation::list_delivery_streams::ListDeliveryStreamsError) -> Self {
match err {
crate::operation::list_delivery_streams::ListDeliveryStreamsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_delivery_stream::ListTagsForDeliveryStreamError, 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_delivery_stream::ListTagsForDeliveryStreamError, 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_delivery_stream::ListTagsForDeliveryStreamError> for Error {
fn from(err: crate::operation::list_tags_for_delivery_stream::ListTagsForDeliveryStreamError) -> Self {
match err {
crate::operation::list_tags_for_delivery_stream::ListTagsForDeliveryStreamError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::list_tags_for_delivery_stream::ListTagsForDeliveryStreamError::LimitExceededException(inner) => {
Error::LimitExceededException(inner)
}
crate::operation::list_tags_for_delivery_stream::ListTagsForDeliveryStreamError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::list_tags_for_delivery_stream::ListTagsForDeliveryStreamError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_record::PutRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_record::PutRecordError, 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::put_record::PutRecordError> for Error {
fn from(err: crate::operation::put_record::PutRecordError) -> Self {
match err {
crate::operation::put_record::PutRecordError::InvalidArgumentException(inner) => Error::InvalidArgumentException(inner),
crate::operation::put_record::PutRecordError::InvalidKmsResourceException(inner) => Error::InvalidKmsResourceException(inner),
crate::operation::put_record::PutRecordError::InvalidSourceException(inner) => Error::InvalidSourceException(inner),
crate::operation::put_record::PutRecordError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::put_record::PutRecordError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::put_record::PutRecordError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_record_batch::PutRecordBatchError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_record_batch::PutRecordBatchError, 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::put_record_batch::PutRecordBatchError> for Error {
fn from(err: crate::operation::put_record_batch::PutRecordBatchError) -> Self {
match err {
crate::operation::put_record_batch::PutRecordBatchError::InvalidArgumentException(inner) => Error::InvalidArgumentException(inner),
crate::operation::put_record_batch::PutRecordBatchError::InvalidKmsResourceException(inner) => Error::InvalidKmsResourceException(inner),
crate::operation::put_record_batch::PutRecordBatchError::InvalidSourceException(inner) => Error::InvalidSourceException(inner),
crate::operation::put_record_batch::PutRecordBatchError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::put_record_batch::PutRecordBatchError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::put_record_batch::PutRecordBatchError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError, R>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError,
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_delivery_stream_encryption::StartDeliveryStreamEncryptionError> for Error {
fn from(err: crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError) -> Self {
match err {
crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError::InvalidKmsResourceException(inner) => {
Error::InvalidKmsResourceException(inner)
}
crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError::LimitExceededException(inner) => {
Error::LimitExceededException(inner)
}
crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError::ResourceInUseException(inner) => {
Error::ResourceInUseException(inner)
}
crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::start_delivery_stream_encryption::StartDeliveryStreamEncryptionError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError,
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_delivery_stream_encryption::StopDeliveryStreamEncryptionError> for Error {
fn from(err: crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError) -> Self {
match err {
crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError::LimitExceededException(inner) => {
Error::LimitExceededException(inner)
}
crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError::ResourceInUseException(inner) => {
Error::ResourceInUseException(inner)
}
crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::stop_delivery_stream_encryption::StopDeliveryStreamEncryptionError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_delivery_stream::TagDeliveryStreamError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_delivery_stream::TagDeliveryStreamError, 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_delivery_stream::TagDeliveryStreamError> for Error {
fn from(err: crate::operation::tag_delivery_stream::TagDeliveryStreamError) -> Self {
match err {
crate::operation::tag_delivery_stream::TagDeliveryStreamError::InvalidArgumentException(inner) => Error::InvalidArgumentException(inner),
crate::operation::tag_delivery_stream::TagDeliveryStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::tag_delivery_stream::TagDeliveryStreamError::ResourceInUseException(inner) => Error::ResourceInUseException(inner),
crate::operation::tag_delivery_stream::TagDeliveryStreamError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::tag_delivery_stream::TagDeliveryStreamError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_delivery_stream::UntagDeliveryStreamError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_delivery_stream::UntagDeliveryStreamError, 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_delivery_stream::UntagDeliveryStreamError> for Error {
fn from(err: crate::operation::untag_delivery_stream::UntagDeliveryStreamError) -> Self {
match err {
crate::operation::untag_delivery_stream::UntagDeliveryStreamError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::untag_delivery_stream::UntagDeliveryStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::untag_delivery_stream::UntagDeliveryStreamError::ResourceInUseException(inner) => Error::ResourceInUseException(inner),
crate::operation::untag_delivery_stream::UntagDeliveryStreamError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::untag_delivery_stream::UntagDeliveryStreamError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_destination::UpdateDestinationError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_destination::UpdateDestinationError, 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_destination::UpdateDestinationError> for Error {
fn from(err: crate::operation::update_destination::UpdateDestinationError) -> Self {
match err {
crate::operation::update_destination::UpdateDestinationError::ConcurrentModificationException(inner) => {
Error::ConcurrentModificationException(inner)
}
crate::operation::update_destination::UpdateDestinationError::InvalidArgumentException(inner) => Error::InvalidArgumentException(inner),
crate::operation::update_destination::UpdateDestinationError::ResourceInUseException(inner) => Error::ResourceInUseException(inner),
crate::operation::update_destination::UpdateDestinationError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::update_destination::UpdateDestinationError::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::ConcurrentModificationException(inner) => inner.source(),
Error::InvalidArgumentException(inner) => inner.source(),
Error::InvalidKmsResourceException(inner) => inner.source(),
Error::InvalidSourceException(inner) => inner.source(),
Error::LimitExceededException(inner) => inner.source(),
Error::ResourceInUseException(inner) => inner.source(),
Error::ResourceNotFoundException(inner) => inner.source(),
Error::ServiceUnavailableException(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::ConcurrentModificationException(e) => e.request_id(),
Self::InvalidArgumentException(e) => e.request_id(),
Self::InvalidKmsResourceException(e) => e.request_id(),
Self::InvalidSourceException(e) => e.request_id(),
Self::LimitExceededException(e) => e.request_id(),
Self::ResourceInUseException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::ServiceUnavailableException(e) => e.request_id(),
Self::Unhandled(e) => e.meta.request_id(),
}
}
}