#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
ActiveStatementsExceededException(crate::error::ActiveStatementsExceededException),
BatchExecuteStatementException(crate::error::BatchExecuteStatementException),
ExecuteStatementException(crate::error::ExecuteStatementException),
InternalServerException(crate::error::InternalServerException),
ResourceNotFoundException(crate::error::ResourceNotFoundException),
ValidationException(crate::error::ValidationException),
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::ActiveStatementsExceededException(inner) => inner.fmt(f),
Error::BatchExecuteStatementException(inner) => inner.fmt(f),
Error::ExecuteStatementException(inner) => inner.fmt(f),
Error::InternalServerException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ValidationException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::BatchExecuteStatementError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::BatchExecuteStatementError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::BatchExecuteStatementErrorKind::ActiveStatementsExceededException(
inner,
) => Error::ActiveStatementsExceededException(inner),
crate::error::BatchExecuteStatementErrorKind::BatchExecuteStatementException(
inner,
) => Error::BatchExecuteStatementException(inner),
crate::error::BatchExecuteStatementErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::BatchExecuteStatementErrorKind::Unhandled(inner) => {
Error::Unhandled(inner)
}
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::CancelStatementError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::CancelStatementError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::CancelStatementErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::CancelStatementErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::CancelStatementErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::CancelStatementErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::DescribeStatementError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::DescribeStatementError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::DescribeStatementErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::DescribeStatementErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::DescribeStatementErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::DescribeStatementErrorKind::Unhandled(inner) => {
Error::Unhandled(inner)
}
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::DescribeTableError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::DescribeTableError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::DescribeTableErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::DescribeTableErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::DescribeTableErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ExecuteStatementError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::ExecuteStatementError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ExecuteStatementErrorKind::ActiveStatementsExceededException(
inner,
) => Error::ActiveStatementsExceededException(inner),
crate::error::ExecuteStatementErrorKind::ExecuteStatementException(inner) => {
Error::ExecuteStatementException(inner)
}
crate::error::ExecuteStatementErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::ExecuteStatementErrorKind::Unhandled(inner) => {
Error::Unhandled(inner)
}
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetStatementResultError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::GetStatementResultError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::GetStatementResultErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::GetStatementResultErrorKind::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::error::GetStatementResultErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::GetStatementResultErrorKind::Unhandled(inner) => {
Error::Unhandled(inner)
}
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListDatabasesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::ListDatabasesError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ListDatabasesErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::ListDatabasesErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::ListDatabasesErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListSchemasError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::ListSchemasError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ListSchemasErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::ListSchemasErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::ListSchemasErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListStatementsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::ListStatementsError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ListStatementsErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::ListStatementsErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::ListStatementsErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListTablesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::ListTablesError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
crate::error::ListTablesErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::ListTablesErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::ListTablesErrorKind::Unhandled(inner) => Error::Unhandled(inner),
},
_ => Error::Unhandled(err.into()),
}
}
}
impl std::error::Error for Error {}