#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
ExpiredIteratorException(crate::error::ExpiredIteratorException),
InternalServerError(crate::error::InternalServerError),
LimitExceededException(crate::error::LimitExceededException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
TrimmedDataAccessException(crate::error::TrimmedDataAccessException),
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::ExpiredIteratorException(inner) => inner.fmt(f),
Error::InternalServerError(inner) => inner.fmt(f),
Error::LimitExceededException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::TrimmedDataAccessException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::DescribeStreamError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::DescribeStreamError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::DescribeStreamErrorKind::InternalServerError(inner) => {
Error::InternalServerError(inner)
}
crate::error::DescribeStreamErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::DescribeStreamErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetRecordsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GetRecordsError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetRecordsErrorKind::ExpiredIteratorException(inner) => {
Error::ExpiredIteratorException(inner)
}
crate::error::GetRecordsErrorKind::InternalServerError(inner) => {
Error::InternalServerError(inner)
}
crate::error::GetRecordsErrorKind::LimitExceededException(inner) => {
Error::LimitExceededException(inner)
}
crate::error::GetRecordsErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::GetRecordsErrorKind::TrimmedDataAccessException(inner) => {
Error::TrimmedDataAccessException(inner)
}
crate::error::GetRecordsErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetShardIteratorError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::GetShardIteratorError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetShardIteratorErrorKind::InternalServerError(inner) => {
Error::InternalServerError(inner)
}
crate::error::GetShardIteratorErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::GetShardIteratorErrorKind::TrimmedDataAccessException(inner) => {
Error::TrimmedDataAccessException(inner)
}
crate::error::GetShardIteratorErrorKind::Unhandled(inner) => {
Error::Unhandled(inner)
}
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListStreamsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::ListStreamsError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ListStreamsErrorKind::InternalServerError(inner) => {
Error::InternalServerError(inner)
}
crate::error::ListStreamsErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::ListStreamsErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl std::error::Error for Error {}