#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
AccessForbidden(crate::types::error::AccessForbidden),
InternalFailure(crate::types::error::InternalFailure),
ResourceNotFound(crate::types::error::ResourceNotFound),
ServiceUnavailable(crate::types::error::ServiceUnavailable),
ValidationError(crate::types::error::ValidationError),
Unhandled(::aws_smithy_types::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 From<::aws_smithy_types::error::operation::BuildError> for Error {
fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
Error::Unhandled(::aws_smithy_types::error::Unhandled::builder().source(value).build())
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::batch_get_record::BatchGetRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::batch_get_record::BatchGetRecordError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::batch_get_record::BatchGetRecordError> for Error {
fn from(err: crate::operation::batch_get_record::BatchGetRecordError) -> Self {
match err {
crate::operation::batch_get_record::BatchGetRecordError::AccessForbidden(inner) => Error::AccessForbidden(inner),
crate::operation::batch_get_record::BatchGetRecordError::InternalFailure(inner) => Error::InternalFailure(inner),
crate::operation::batch_get_record::BatchGetRecordError::ServiceUnavailable(inner) => Error::ServiceUnavailable(inner),
crate::operation::batch_get_record::BatchGetRecordError::ValidationError(inner) => Error::ValidationError(inner),
crate::operation::batch_get_record::BatchGetRecordError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_record::DeleteRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_record::DeleteRecordError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_record::DeleteRecordError> for Error {
fn from(err: crate::operation::delete_record::DeleteRecordError) -> Self {
match err {
crate::operation::delete_record::DeleteRecordError::AccessForbidden(inner) => Error::AccessForbidden(inner),
crate::operation::delete_record::DeleteRecordError::InternalFailure(inner) => Error::InternalFailure(inner),
crate::operation::delete_record::DeleteRecordError::ServiceUnavailable(inner) => Error::ServiceUnavailable(inner),
crate::operation::delete_record::DeleteRecordError::ValidationError(inner) => Error::ValidationError(inner),
crate::operation::delete_record::DeleteRecordError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_record::GetRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_record::GetRecordError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::get_record::GetRecordError> for Error {
fn from(err: crate::operation::get_record::GetRecordError) -> Self {
match err {
crate::operation::get_record::GetRecordError::AccessForbidden(inner) => Error::AccessForbidden(inner),
crate::operation::get_record::GetRecordError::InternalFailure(inner) => Error::InternalFailure(inner),
crate::operation::get_record::GetRecordError::ResourceNotFound(inner) => Error::ResourceNotFound(inner),
crate::operation::get_record::GetRecordError::ServiceUnavailable(inner) => Error::ServiceUnavailable(inner),
crate::operation::get_record::GetRecordError::ValidationError(inner) => Error::ValidationError(inner),
crate::operation::get_record::GetRecordError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_record::PutRecordError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_record::PutRecordError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::put_record::PutRecordError> for Error {
fn from(err: crate::operation::put_record::PutRecordError) -> Self {
match err {
crate::operation::put_record::PutRecordError::AccessForbidden(inner) => Error::AccessForbidden(inner),
crate::operation::put_record::PutRecordError::InternalFailure(inner) => Error::InternalFailure(inner),
crate::operation::put_record::PutRecordError::ServiceUnavailable(inner) => Error::ServiceUnavailable(inner),
crate::operation::put_record::PutRecordError::ValidationError(inner) => Error::ValidationError(inner),
crate::operation::put_record::PutRecordError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl ::std::error::Error for Error {
fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Error::AccessForbidden(inner) => inner.source(),
Error::InternalFailure(inner) => inner.source(),
Error::ResourceNotFound(inner) => inner.source(),
Error::ServiceUnavailable(inner) => inner.source(),
Error::ValidationError(inner) => inner.source(),
Error::Unhandled(inner) => inner.source(),
}
}
}
impl ::aws_http::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::AccessForbidden(e) => e.request_id(),
Self::InternalFailure(e) => e.request_id(),
Self::ResourceNotFound(e) => e.request_id(),
Self::ServiceUnavailable(e) => e.request_id(),
Self::ValidationError(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}