#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
MarketplaceCommerceAnalyticsException(crate::error::MarketplaceCommerceAnalyticsException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::MarketplaceCommerceAnalyticsException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GenerateDataSetError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GenerateDataSetError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
}
impl From<crate::error::GenerateDataSetError> for Error {
fn from(err: crate::error::GenerateDataSetError) -> Self {
match err.kind {
crate::error::GenerateDataSetErrorKind::MarketplaceCommerceAnalyticsException(
inner,
) => Error::MarketplaceCommerceAnalyticsException(inner),
crate::error::GenerateDataSetErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::StartSupportDataExportError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::StartSupportDataExportError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
}
impl From<crate::error::StartSupportDataExportError> for Error {
fn from(err: crate::error::StartSupportDataExportError) -> Self {
match err.kind {
crate::error::StartSupportDataExportErrorKind::MarketplaceCommerceAnalyticsException(inner) => Error::MarketplaceCommerceAnalyticsException(inner),
crate::error::StartSupportDataExportErrorKind::Unhandled(inner) => Error::Unhandled(crate::error::Unhandled::new(inner.into())),
}
}
}
impl std::error::Error for Error {}