#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
ForbiddenException(crate::types::error::ForbiddenException),
GoneException(crate::types::error::GoneException),
LimitExceededException(crate::types::error::LimitExceededException),
PayloadTooLargeException(crate::types::error::PayloadTooLargeException),
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::ForbiddenException(inner) => inner.fmt(f),
Error::GoneException(inner) => inner.fmt(f),
Error::LimitExceededException(inner) => inner.fmt(f),
Error::PayloadTooLargeException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::delete_connection::DeleteConnectionError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::delete_connection::DeleteConnectionError, R>) -> Self {
match err {
::aws_smithy_http::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_connection::DeleteConnectionError> for Error {
fn from(err: crate::operation::delete_connection::DeleteConnectionError) -> Self {
match err {
crate::operation::delete_connection::DeleteConnectionError::ForbiddenException(inner) => Error::ForbiddenException(inner),
crate::operation::delete_connection::DeleteConnectionError::GoneException(inner) => Error::GoneException(inner),
crate::operation::delete_connection::DeleteConnectionError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::delete_connection::DeleteConnectionError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_connection::GetConnectionError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_connection::GetConnectionError, R>) -> Self {
match err {
::aws_smithy_http::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_connection::GetConnectionError> for Error {
fn from(err: crate::operation::get_connection::GetConnectionError) -> Self {
match err {
crate::operation::get_connection::GetConnectionError::ForbiddenException(inner) => Error::ForbiddenException(inner),
crate::operation::get_connection::GetConnectionError::GoneException(inner) => Error::GoneException(inner),
crate::operation::get_connection::GetConnectionError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::get_connection::GetConnectionError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::post_to_connection::PostToConnectionError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::post_to_connection::PostToConnectionError, R>) -> Self {
match err {
::aws_smithy_http::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::post_to_connection::PostToConnectionError> for Error {
fn from(err: crate::operation::post_to_connection::PostToConnectionError) -> Self {
match err {
crate::operation::post_to_connection::PostToConnectionError::ForbiddenException(inner) => Error::ForbiddenException(inner),
crate::operation::post_to_connection::PostToConnectionError::GoneException(inner) => Error::GoneException(inner),
crate::operation::post_to_connection::PostToConnectionError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::post_to_connection::PostToConnectionError::PayloadTooLargeException(inner) => Error::PayloadTooLargeException(inner),
crate::operation::post_to_connection::PostToConnectionError::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::ForbiddenException(inner) => inner.source(),
Error::GoneException(inner) => inner.source(),
Error::LimitExceededException(inner) => inner.source(),
Error::PayloadTooLargeException(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::ForbiddenException(e) => e.request_id(),
Self::GoneException(e) => e.request_id(),
Self::LimitExceededException(e) => e.request_id(),
Self::PayloadTooLargeException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}