#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
AccessDeniedException(crate::types::error::AccessDeniedException),
ConflictException(crate::types::error::ConflictException),
InternalServerException(crate::types::error::InternalServerException),
OutpostOfflineException(crate::types::error::OutpostOfflineException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ThrottlingException(crate::types::error::ThrottlingException),
ValidationException(crate::types::error::ValidationException),
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::AccessDeniedException(inner) => inner.fmt(f),
Error::ConflictException(inner) => inner.fmt(f),
Error::InternalServerException(inner) => inner.fmt(f),
Error::OutpostOfflineException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ThrottlingException(inner) => inner.fmt(f),
Error::ValidationException(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::create_endpoint::CreateEndpointError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_endpoint::CreateEndpointError, 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::create_endpoint::CreateEndpointError> for Error {
fn from(err: crate::operation::create_endpoint::CreateEndpointError) -> Self {
match err {
crate::operation::create_endpoint::CreateEndpointError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::create_endpoint::CreateEndpointError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::create_endpoint::CreateEndpointError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::create_endpoint::CreateEndpointError::OutpostOfflineException(inner) => Error::OutpostOfflineException(inner),
crate::operation::create_endpoint::CreateEndpointError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::create_endpoint::CreateEndpointError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::create_endpoint::CreateEndpointError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::create_endpoint::CreateEndpointError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_endpoint::DeleteEndpointError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_endpoint::DeleteEndpointError, 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_endpoint::DeleteEndpointError> for Error {
fn from(err: crate::operation::delete_endpoint::DeleteEndpointError) -> Self {
match err {
crate::operation::delete_endpoint::DeleteEndpointError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::delete_endpoint::DeleteEndpointError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::delete_endpoint::DeleteEndpointError::OutpostOfflineException(inner) => Error::OutpostOfflineException(inner),
crate::operation::delete_endpoint::DeleteEndpointError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::delete_endpoint::DeleteEndpointError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::delete_endpoint::DeleteEndpointError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::delete_endpoint::DeleteEndpointError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_endpoints::ListEndpointsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_endpoints::ListEndpointsError, 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::list_endpoints::ListEndpointsError> for Error {
fn from(err: crate::operation::list_endpoints::ListEndpointsError) -> Self {
match err {
crate::operation::list_endpoints::ListEndpointsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::list_endpoints::ListEndpointsError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::list_endpoints::ListEndpointsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::list_endpoints::ListEndpointsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_endpoints::ListEndpointsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_endpoints::ListEndpointsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error, 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::list_outposts_with_s3::ListOutpostsWithS3Error> for Error {
fn from(err: crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error) -> Self {
match err {
crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_outposts_with_s3::ListOutpostsWithS3Error::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_shared_endpoints::ListSharedEndpointsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_shared_endpoints::ListSharedEndpointsError, 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::list_shared_endpoints::ListSharedEndpointsError> for Error {
fn from(err: crate::operation::list_shared_endpoints::ListSharedEndpointsError) -> Self {
match err {
crate::operation::list_shared_endpoints::ListSharedEndpointsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::list_shared_endpoints::ListSharedEndpointsError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_shared_endpoints::ListSharedEndpointsError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::list_shared_endpoints::ListSharedEndpointsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_shared_endpoints::ListSharedEndpointsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_shared_endpoints::ListSharedEndpointsError::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::AccessDeniedException(inner) => inner.source(),
Error::ConflictException(inner) => inner.source(),
Error::InternalServerException(inner) => inner.source(),
Error::OutpostOfflineException(inner) => inner.source(),
Error::ResourceNotFoundException(inner) => inner.source(),
Error::ThrottlingException(inner) => inner.source(),
Error::ValidationException(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::AccessDeniedException(e) => e.request_id(),
Self::ConflictException(e) => e.request_id(),
Self::InternalServerException(e) => e.request_id(),
Self::OutpostOfflineException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::ThrottlingException(e) => e.request_id(),
Self::ValidationException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}