#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
BadRequestError(crate::error::BadRequestError),
ForbiddenError(crate::error::ForbiddenError),
InternalError(crate::error::InternalError),
NotFoundError(crate::error::NotFoundError),
RateLimitError(crate::error::RateLimitError),
UnauthorizedError(crate::error::UnauthorizedError),
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::BadRequestError(inner) => inner.fmt(f),
Error::ForbiddenError(inner) => inner.fmt(f),
Error::InternalError(inner) => inner.fmt(f),
Error::NotFoundError(inner) => inner.fmt(f),
Error::RateLimitError(inner) => inner.fmt(f),
Error::UnauthorizedError(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::DeleteError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::DeleteError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::DeleteErrorKind::InternalError(inner) => Error::InternalError(inner),
crate::error::DeleteErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::DeleteErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::DeleteErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::DeleteErrorKind::NotFoundError(inner) => Error::NotFoundError(inner),
crate::error::DeleteErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::DeleteErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::DeleteBatchError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::DeleteBatchError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::DeleteBatchErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::DeleteBatchErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::DeleteBatchErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::DeleteBatchErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::DeleteBatchErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::DeleteBatchErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::DeleteBatchErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GetError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetErrorKind::InternalError(inner) => Error::InternalError(inner),
crate::error::GetErrorKind::RateLimitError(inner) => Error::RateLimitError(inner),
crate::error::GetErrorKind::ForbiddenError(inner) => Error::ForbiddenError(inner),
crate::error::GetErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::GetErrorKind::NotFoundError(inner) => Error::NotFoundError(inner),
crate::error::GetErrorKind::BadRequestError(inner) => Error::BadRequestError(inner),
crate::error::GetErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetBatchError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GetBatchError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetBatchErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::GetBatchErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::GetBatchErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::GetBatchErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::GetBatchErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::GetBatchErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::GetBatchErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PutError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::PutError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::PutErrorKind::InternalError(inner) => Error::InternalError(inner),
crate::error::PutErrorKind::RateLimitError(inner) => Error::RateLimitError(inner),
crate::error::PutErrorKind::ForbiddenError(inner) => Error::ForbiddenError(inner),
crate::error::PutErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::PutErrorKind::NotFoundError(inner) => Error::NotFoundError(inner),
crate::error::PutErrorKind::BadRequestError(inner) => Error::BadRequestError(inner),
crate::error::PutErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PutBatchError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::PutBatchError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::PutBatchErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::PutBatchErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::PutBatchErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::PutBatchErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::PutBatchErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::PutBatchErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::PutBatchErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl std::error::Error for Error {}