#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
InvalidInputException(crate::error::InvalidInputException),
ResourceInUseException(crate::error::ResourceInUseException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::InvalidInputException(inner) => inner.fmt(f),
Error::ResourceInUseException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PutEventsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::PutEventsError, 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::PutEventsError> for Error {
fn from(err: crate::error::PutEventsError) -> Self {
match err.kind {
crate::error::PutEventsErrorKind::InvalidInputException(inner) => {
Error::InvalidInputException(inner)
}
crate::error::PutEventsErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PutItemsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::PutItemsError, 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::PutItemsError> for Error {
fn from(err: crate::error::PutItemsError) -> Self {
match err.kind {
crate::error::PutItemsErrorKind::InvalidInputException(inner) => {
Error::InvalidInputException(inner)
}
crate::error::PutItemsErrorKind::ResourceInUseException(inner) => {
Error::ResourceInUseException(inner)
}
crate::error::PutItemsErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::PutItemsErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PutUsersError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::PutUsersError, 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::PutUsersError> for Error {
fn from(err: crate::error::PutUsersError) -> Self {
match err.kind {
crate::error::PutUsersErrorKind::InvalidInputException(inner) => {
Error::InvalidInputException(inner)
}
crate::error::PutUsersErrorKind::ResourceInUseException(inner) => {
Error::ResourceInUseException(inner)
}
crate::error::PutUsersErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::PutUsersErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl std::error::Error for Error {}