#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
InternalServerException(crate::error::InternalServerException),
ThrottlingException(crate::error::ThrottlingException),
ValidationException(crate::error::ValidationException),
Unhandled(crate::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::error::GetServiceSettingsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::GetServiceSettingsError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
}
impl From<crate::error::GetServiceSettingsError> for Error {
fn from(err: crate::error::GetServiceSettingsError) -> Self {
match err.kind {
crate::error::GetServiceSettingsErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::GetServiceSettingsErrorKind::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::error::GetServiceSettingsErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::GetServiceSettingsErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::error::ListLinuxSubscriptionInstancesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::error::ListLinuxSubscriptionInstancesError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
}
impl From<crate::error::ListLinuxSubscriptionInstancesError> for Error {
fn from(err: crate::error::ListLinuxSubscriptionInstancesError) -> Self {
match err.kind {
crate::error::ListLinuxSubscriptionInstancesErrorKind::InternalServerException(
inner,
) => Error::InternalServerException(inner),
crate::error::ListLinuxSubscriptionInstancesErrorKind::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::error::ListLinuxSubscriptionInstancesErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::ListLinuxSubscriptionInstancesErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListLinuxSubscriptionsError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::ListLinuxSubscriptionsError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
}
impl From<crate::error::ListLinuxSubscriptionsError> for Error {
fn from(err: crate::error::ListLinuxSubscriptionsError) -> Self {
match err.kind {
crate::error::ListLinuxSubscriptionsErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::ListLinuxSubscriptionsErrorKind::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::error::ListLinuxSubscriptionsErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::ListLinuxSubscriptionsErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::UpdateServiceSettingsError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::error::UpdateServiceSettingsError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
}
impl From<crate::error::UpdateServiceSettingsError> for Error {
fn from(err: crate::error::UpdateServiceSettingsError) -> Self {
match err.kind {
crate::error::UpdateServiceSettingsErrorKind::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::error::UpdateServiceSettingsErrorKind::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::error::UpdateServiceSettingsErrorKind::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::error::UpdateServiceSettingsErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl std::error::Error for Error {}