#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
AccessForbidden(crate::error::AccessForbidden),
InternalFailure(crate::error::InternalFailure),
ResourceNotFound(crate::error::ResourceNotFound),
ServiceUnavailable(crate::error::ServiceUnavailable),
ValidationError(crate::error::ValidationError),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::AccessForbidden(inner) => inner.fmt(f),
Error::InternalFailure(inner) => inner.fmt(f),
Error::ResourceNotFound(inner) => inner.fmt(f),
Error::ServiceUnavailable(inner) => inner.fmt(f),
Error::ValidationError(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::BatchGetRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::BatchGetRecordError, 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::BatchGetRecordError> for Error {
fn from(err: crate::error::BatchGetRecordError) -> Self {
match err.kind {
crate::error::BatchGetRecordErrorKind::AccessForbidden(inner) => {
Error::AccessForbidden(inner)
}
crate::error::BatchGetRecordErrorKind::InternalFailure(inner) => {
Error::InternalFailure(inner)
}
crate::error::BatchGetRecordErrorKind::ServiceUnavailable(inner) => {
Error::ServiceUnavailable(inner)
}
crate::error::BatchGetRecordErrorKind::ValidationError(inner) => {
Error::ValidationError(inner)
}
crate::error::BatchGetRecordErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::DeleteRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::DeleteRecordError, 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::DeleteRecordError> for Error {
fn from(err: crate::error::DeleteRecordError) -> Self {
match err.kind {
crate::error::DeleteRecordErrorKind::AccessForbidden(inner) => {
Error::AccessForbidden(inner)
}
crate::error::DeleteRecordErrorKind::InternalFailure(inner) => {
Error::InternalFailure(inner)
}
crate::error::DeleteRecordErrorKind::ServiceUnavailable(inner) => {
Error::ServiceUnavailable(inner)
}
crate::error::DeleteRecordErrorKind::ValidationError(inner) => {
Error::ValidationError(inner)
}
crate::error::DeleteRecordErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GetRecordError, 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::GetRecordError> for Error {
fn from(err: crate::error::GetRecordError) -> Self {
match err.kind {
crate::error::GetRecordErrorKind::AccessForbidden(inner) => {
Error::AccessForbidden(inner)
}
crate::error::GetRecordErrorKind::InternalFailure(inner) => {
Error::InternalFailure(inner)
}
crate::error::GetRecordErrorKind::ResourceNotFound(inner) => {
Error::ResourceNotFound(inner)
}
crate::error::GetRecordErrorKind::ServiceUnavailable(inner) => {
Error::ServiceUnavailable(inner)
}
crate::error::GetRecordErrorKind::ValidationError(inner) => {
Error::ValidationError(inner)
}
crate::error::GetRecordErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PutRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::PutRecordError, 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::PutRecordError> for Error {
fn from(err: crate::error::PutRecordError) -> Self {
match err.kind {
crate::error::PutRecordErrorKind::AccessForbidden(inner) => {
Error::AccessForbidden(inner)
}
crate::error::PutRecordErrorKind::InternalFailure(inner) => {
Error::InternalFailure(inner)
}
crate::error::PutRecordErrorKind::ServiceUnavailable(inner) => {
Error::ServiceUnavailable(inner)
}
crate::error::PutRecordErrorKind::ValidationError(inner) => {
Error::ValidationError(inner)
}
crate::error::PutRecordErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl std::error::Error for Error {}