aws-sdk-appconfigcloudextension 1.0.0

AWS SDK for AWS AppConfig Cloud Extension
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// All possible error types for this service.
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
    /// Access was denied. The reason says whether AWS Cloud Extensions couldn't authenticate the caller, or a service the Extension calls denied it.
    AccessDeniedException(crate::types::error::AccessDeniedException),
    /// No usable answer came back: from the service AWS Cloud Extensions retrieves its profile from, from the Extension, or from a service the Extension calls. The reason says what to do, such as fixing the profile or role, checking the Extension's settings, or using an earlier version of the Extension.
    BadGatewayException(crate::types::error::BadGatewayException),
    /// An unexpected internal error occurred. Retry the request.
    InternalServerException(crate::types::error::InternalServerException),
    /// The request is part of a chain of calls that loops back through AWS Cloud Extensions.
    LoopDetectedException(crate::types::error::LoopDetectedException),
    /// The request body is larger than AWS Cloud Extensions accepts.
    RequestEntityTooLargeException(crate::types::error::RequestEntityTooLargeException),
    /// AWS Cloud Extensions can't serve the request now. Retry it.
    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
    /// The call was throttled. Retry after the time Retry-After gives, when it is set. The reason says what throttled it.
    ThrottlingException(crate::types::error::ThrottlingException),
    /// The Extension needs a newer version of AWS Cloud Extensions. Upgrade it, or use an earlier version of the Extension.
    UpgradeRequiredException(crate::types::error::UpgradeRequiredException),
    /// The request does not fit the operation's model. The message describes every failure and may change; read reason and errors to act on them.
    ValidationException(crate::types::error::ValidationException),
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
    variable wildcard pattern and check `.code()`:
     \
       `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
     \
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
    Unhandled(crate::error::sealed_unhandled::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::BadGatewayException(inner) => inner.fmt(f),
            Error::InternalServerException(inner) => inner.fmt(f),
            Error::LoopDetectedException(inner) => inner.fmt(f),
            Error::RequestEntityTooLargeException(inner) => inner.fmt(f),
            Error::ServiceUnavailableException(inner) => inner.fmt(f),
            Error::ThrottlingException(inner) => inner.fmt(f),
            Error::UpgradeRequiredException(inner) => inner.fmt(f),
            Error::ValidationException(inner) => inner.fmt(f),
            Error::Unhandled(_) => {
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
                    write!(f, "unhandled error ({code})")
                } else {
                    f.write_str("unhandled error")
                }
            }
        }
    }
}
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
            source: value.into(),
            meta: ::std::default::Default::default(),
        })
    }
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
        match self {
            Self::AccessDeniedException(inner) => inner.meta(),
            Self::BadGatewayException(inner) => inner.meta(),
            Self::InternalServerException(inner) => inner.meta(),
            Self::LoopDetectedException(inner) => inner.meta(),
            Self::RequestEntityTooLargeException(inner) => inner.meta(),
            Self::ServiceUnavailableException(inner) => inner.meta(),
            Self::ThrottlingException(inner) => inner.meta(),
            Self::UpgradeRequiredException(inner) => inner.meta(),
            Self::ValidationException(inner) => inner.meta(),
            Self::Unhandled(inner) => &inner.meta,
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_configuration::GetConfigurationError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_configuration::GetConfigurationError, R>) -> Self {
        match err {
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
                source: err.into(),
            }),
        }
    }
}
impl From<crate::operation::get_configuration::GetConfigurationError> for Error {
    fn from(err: crate::operation::get_configuration::GetConfigurationError) -> Self {
        match err {
            crate::operation::get_configuration::GetConfigurationError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::get_configuration::GetConfigurationError::BadGatewayException(inner) => Error::BadGatewayException(inner),
            crate::operation::get_configuration::GetConfigurationError::InternalServerException(inner) => Error::InternalServerException(inner),
            crate::operation::get_configuration::GetConfigurationError::LoopDetectedException(inner) => Error::LoopDetectedException(inner),
            crate::operation::get_configuration::GetConfigurationError::RequestEntityTooLargeException(inner) => {
                Error::RequestEntityTooLargeException(inner)
            }
            crate::operation::get_configuration::GetConfigurationError::ServiceUnavailableException(inner) => {
                Error::ServiceUnavailableException(inner)
            }
            crate::operation::get_configuration::GetConfigurationError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::get_configuration::GetConfigurationError::UpgradeRequiredException(inner) => Error::UpgradeRequiredException(inner),
            crate::operation::get_configuration::GetConfigurationError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::get_configuration::GetConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_flag::GetFlagError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_flag::GetFlagError, R>) -> Self {
        match err {
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
                source: err.into(),
            }),
        }
    }
}
impl From<crate::operation::get_flag::GetFlagError> for Error {
    fn from(err: crate::operation::get_flag::GetFlagError) -> Self {
        match err {
            crate::operation::get_flag::GetFlagError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::get_flag::GetFlagError::BadGatewayException(inner) => Error::BadGatewayException(inner),
            crate::operation::get_flag::GetFlagError::InternalServerException(inner) => Error::InternalServerException(inner),
            crate::operation::get_flag::GetFlagError::LoopDetectedException(inner) => Error::LoopDetectedException(inner),
            crate::operation::get_flag::GetFlagError::RequestEntityTooLargeException(inner) => Error::RequestEntityTooLargeException(inner),
            crate::operation::get_flag::GetFlagError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
            crate::operation::get_flag::GetFlagError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::get_flag::GetFlagError::UpgradeRequiredException(inner) => Error::UpgradeRequiredException(inner),
            crate::operation::get_flag::GetFlagError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::get_flag::GetFlagError::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::BadGatewayException(inner) => inner.source(),
            Error::InternalServerException(inner) => inner.source(),
            Error::LoopDetectedException(inner) => inner.source(),
            Error::RequestEntityTooLargeException(inner) => inner.source(),
            Error::ServiceUnavailableException(inner) => inner.source(),
            Error::ThrottlingException(inner) => inner.source(),
            Error::UpgradeRequiredException(inner) => inner.source(),
            Error::ValidationException(inner) => inner.source(),
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
        }
    }
}
impl ::aws_types::request_id::RequestId for Error {
    fn request_id(&self) -> Option<&str> {
        match self {
            Self::AccessDeniedException(e) => e.request_id(),
            Self::BadGatewayException(e) => e.request_id(),
            Self::InternalServerException(e) => e.request_id(),
            Self::LoopDetectedException(e) => e.request_id(),
            Self::RequestEntityTooLargeException(e) => e.request_id(),
            Self::ServiceUnavailableException(e) => e.request_id(),
            Self::ThrottlingException(e) => e.request_id(),
            Self::UpgradeRequiredException(e) => e.request_id(),
            Self::ValidationException(e) => e.request_id(),
            Self::Unhandled(e) => e.meta.request_id(),
        }
    }
}