#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
InternalServerException(crate::types::error::InternalServerException),
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::InternalServerException(inner) => inner.fmt(f),
Error::ThrottlingException(inner) => inner.fmt(f),
Error::ValidationException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_service_settings::GetServiceSettingsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_service_settings::GetServiceSettingsError, 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_service_settings::GetServiceSettingsError> for Error {
fn from(err: crate::operation::get_service_settings::GetServiceSettingsError) -> Self {
match err {
crate::operation::get_service_settings::GetServiceSettingsError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::get_service_settings::GetServiceSettingsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::get_service_settings::GetServiceSettingsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::get_service_settings::GetServiceSettingsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_linux_subscription_instances::ListLinuxSubscriptionInstancesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_http::result::SdkError<crate::operation::list_linux_subscription_instances::ListLinuxSubscriptionInstancesError, 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_linux_subscription_instances::ListLinuxSubscriptionInstancesError> for Error {
fn from(err: crate::operation::list_linux_subscription_instances::ListLinuxSubscriptionInstancesError) -> Self {
match err {
crate::operation::list_linux_subscription_instances::ListLinuxSubscriptionInstancesError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_linux_subscription_instances::ListLinuxSubscriptionInstancesError::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::operation::list_linux_subscription_instances::ListLinuxSubscriptionInstancesError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::list_linux_subscription_instances::ListLinuxSubscriptionInstancesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_linux_subscriptions::ListLinuxSubscriptionsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_linux_subscriptions::ListLinuxSubscriptionsError, 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_linux_subscriptions::ListLinuxSubscriptionsError> for Error {
fn from(err: crate::operation::list_linux_subscriptions::ListLinuxSubscriptionsError) -> Self {
match err {
crate::operation::list_linux_subscriptions::ListLinuxSubscriptionsError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_linux_subscriptions::ListLinuxSubscriptionsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_linux_subscriptions::ListLinuxSubscriptionsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_linux_subscriptions::ListLinuxSubscriptionsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::update_service_settings::UpdateServiceSettingsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::update_service_settings::UpdateServiceSettingsError, 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_service_settings::UpdateServiceSettingsError> for Error {
fn from(err: crate::operation::update_service_settings::UpdateServiceSettingsError) -> Self {
match err {
crate::operation::update_service_settings::UpdateServiceSettingsError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::update_service_settings::UpdateServiceSettingsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::update_service_settings::UpdateServiceSettingsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::update_service_settings::UpdateServiceSettingsError::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::InternalServerException(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::InternalServerException(e) => e.request_id(),
Self::ThrottlingException(e) => e.request_id(),
Self::ValidationException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}