#[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::GetDirectThreadError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GetDirectThreadError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetDirectThreadErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::GetDirectThreadErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::GetDirectThreadErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::GetDirectThreadErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::GetDirectThreadErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::GetDirectThreadErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::GetDirectThreadErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetThreadHistoryError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::GetThreadHistoryError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetThreadHistoryErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::GetThreadHistoryErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::GetThreadHistoryErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::GetThreadHistoryErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::GetThreadHistoryErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::GetThreadHistoryErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::GetThreadHistoryErrorKind::Unhandled(inner) => {
Error::Unhandled(inner)
}
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetThreadTopicError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GetThreadTopicError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetThreadTopicErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::GetThreadTopicErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::GetThreadTopicErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::GetThreadTopicErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::GetThreadTopicErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::GetThreadTopicErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::GetThreadTopicErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::SendChatMessageError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::SendChatMessageError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::SendChatMessageErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::SendChatMessageErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::SendChatMessageErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::SendChatMessageErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::SendChatMessageErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::SendChatMessageErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::SendChatMessageErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::SetThreadReadError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::SetThreadReadError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::SetThreadReadErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::SetThreadReadErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::SetThreadReadErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::SetThreadReadErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::SetThreadReadErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::SetThreadReadErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::SetThreadReadErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::SetTypingStatusError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::SetTypingStatusError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::SetTypingStatusErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::SetTypingStatusErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::SetTypingStatusErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::SetTypingStatusErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::SetTypingStatusErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::SetTypingStatusErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::SetTypingStatusErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::WatchThreadError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::WatchThreadError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::WatchThreadErrorKind::InternalError(inner) => {
Error::InternalError(inner)
}
crate::error::WatchThreadErrorKind::RateLimitError(inner) => {
Error::RateLimitError(inner)
}
crate::error::WatchThreadErrorKind::ForbiddenError(inner) => {
Error::ForbiddenError(inner)
}
crate::error::WatchThreadErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::WatchThreadErrorKind::NotFoundError(inner) => {
Error::NotFoundError(inner)
}
crate::error::WatchThreadErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::WatchThreadErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl std::error::Error for Error {}