#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
ConflictException(crate::types::error::ConflictException),
InternalFailureException(crate::types::error::InternalFailureException),
InvalidRequestException(crate::types::error::InvalidRequestException),
MethodNotAllowedException(crate::types::error::MethodNotAllowedException),
RequestEntityTooLargeException(crate::types::error::RequestEntityTooLargeException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
ThrottlingException(crate::types::error::ThrottlingException),
UnauthorizedException(crate::types::error::UnauthorizedException),
UnsupportedDocumentEncodingException(crate::types::error::UnsupportedDocumentEncodingException),
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::ConflictException(inner) => inner.fmt(f),
Error::InternalFailureException(inner) => inner.fmt(f),
Error::InvalidRequestException(inner) => inner.fmt(f),
Error::MethodNotAllowedException(inner) => inner.fmt(f),
Error::RequestEntityTooLargeException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ServiceUnavailableException(inner) => inner.fmt(f),
Error::ThrottlingException(inner) => inner.fmt(f),
Error::UnauthorizedException(inner) => inner.fmt(f),
Error::UnsupportedDocumentEncodingException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::delete_thing_shadow::DeleteThingShadowError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::delete_thing_shadow::DeleteThingShadowError,
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_thing_shadow::DeleteThingShadowError> for Error {
fn from(err: crate::operation::delete_thing_shadow::DeleteThingShadowError) -> Self {
match err {
crate::operation::delete_thing_shadow::DeleteThingShadowError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::MethodNotAllowedException(inner) => Error::MethodNotAllowedException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::UnsupportedDocumentEncodingException(inner) => Error::UnsupportedDocumentEncodingException(inner),
crate::operation::delete_thing_shadow::DeleteThingShadowError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::get_retained_message::GetRetainedMessageError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::get_retained_message::GetRetainedMessageError,
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_retained_message::GetRetainedMessageError> for Error {
fn from(err: crate::operation::get_retained_message::GetRetainedMessageError) -> Self {
match err {
crate::operation::get_retained_message::GetRetainedMessageError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::get_retained_message::GetRetainedMessageError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::get_retained_message::GetRetainedMessageError::MethodNotAllowedException(inner) => Error::MethodNotAllowedException(inner),
crate::operation::get_retained_message::GetRetainedMessageError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::get_retained_message::GetRetainedMessageError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::get_retained_message::GetRetainedMessageError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::get_retained_message::GetRetainedMessageError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
crate::operation::get_retained_message::GetRetainedMessageError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::get_thing_shadow::GetThingShadowError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::get_thing_shadow::GetThingShadowError,
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_thing_shadow::GetThingShadowError> for Error {
fn from(err: crate::operation::get_thing_shadow::GetThingShadowError) -> Self {
match err {
crate::operation::get_thing_shadow::GetThingShadowError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::MethodNotAllowedException(inner) => Error::MethodNotAllowedException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::UnsupportedDocumentEncodingException(inner) => Error::UnsupportedDocumentEncodingException(inner),
crate::operation::get_thing_shadow::GetThingShadowError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError,
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::list_named_shadows_for_thing::ListNamedShadowsForThingError> for Error {
fn from(
err: crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError,
) -> Self {
match err {
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::MethodNotAllowedException(inner) => Error::MethodNotAllowedException(inner),
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
crate::operation::list_named_shadows_for_thing::ListNamedShadowsForThingError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::list_retained_messages::ListRetainedMessagesError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::list_retained_messages::ListRetainedMessagesError,
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::list_retained_messages::ListRetainedMessagesError> for Error {
fn from(err: crate::operation::list_retained_messages::ListRetainedMessagesError) -> Self {
match err {
crate::operation::list_retained_messages::ListRetainedMessagesError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::list_retained_messages::ListRetainedMessagesError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::list_retained_messages::ListRetainedMessagesError::MethodNotAllowedException(inner) => Error::MethodNotAllowedException(inner),
crate::operation::list_retained_messages::ListRetainedMessagesError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::list_retained_messages::ListRetainedMessagesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_retained_messages::ListRetainedMessagesError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
crate::operation::list_retained_messages::ListRetainedMessagesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::publish::PublishError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::publish::PublishError, 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::publish::PublishError> for Error {
fn from(err: crate::operation::publish::PublishError) -> Self {
match err {
crate::operation::publish::PublishError::InternalFailureException(inner) => {
Error::InternalFailureException(inner)
}
crate::operation::publish::PublishError::InvalidRequestException(inner) => {
Error::InvalidRequestException(inner)
}
crate::operation::publish::PublishError::MethodNotAllowedException(inner) => {
Error::MethodNotAllowedException(inner)
}
crate::operation::publish::PublishError::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::operation::publish::PublishError::UnauthorizedException(inner) => {
Error::UnauthorizedException(inner)
}
crate::operation::publish::PublishError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::update_thing_shadow::UpdateThingShadowError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::update_thing_shadow::UpdateThingShadowError,
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::update_thing_shadow::UpdateThingShadowError> for Error {
fn from(err: crate::operation::update_thing_shadow::UpdateThingShadowError) -> Self {
match err {
crate::operation::update_thing_shadow::UpdateThingShadowError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::MethodNotAllowedException(inner) => Error::MethodNotAllowedException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::RequestEntityTooLargeException(inner) => Error::RequestEntityTooLargeException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::UnsupportedDocumentEncodingException(inner) => Error::UnsupportedDocumentEncodingException(inner),
crate::operation::update_thing_shadow::UpdateThingShadowError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl std::error::Error for Error {}
impl aws_http::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::ConflictException(e) => e.request_id(),
Self::InternalFailureException(e) => e.request_id(),
Self::InvalidRequestException(e) => e.request_id(),
Self::MethodNotAllowedException(e) => e.request_id(),
Self::RequestEntityTooLargeException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::ServiceUnavailableException(e) => e.request_id(),
Self::ThrottlingException(e) => e.request_id(),
Self::UnauthorizedException(e) => e.request_id(),
Self::UnsupportedDocumentEncodingException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}