Skip to main content

aws_sdk_appconfigcloudextension/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// Access was denied. The reason says whether AWS Cloud Extensions couldn't authenticate the caller, or a service the Extension calls denied it.
7    AccessDeniedException(crate::types::error::AccessDeniedException),
8    /// 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.
9    BadGatewayException(crate::types::error::BadGatewayException),
10    /// An unexpected internal error occurred. Retry the request.
11    InternalServerException(crate::types::error::InternalServerException),
12    /// The request is part of a chain of calls that loops back through AWS Cloud Extensions.
13    LoopDetectedException(crate::types::error::LoopDetectedException),
14    /// The request body is larger than AWS Cloud Extensions accepts.
15    RequestEntityTooLargeException(crate::types::error::RequestEntityTooLargeException),
16    /// AWS Cloud Extensions can't serve the request now. Retry it.
17    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
18    /// The call was throttled. Retry after the time Retry-After gives, when it is set. The reason says what throttled it.
19    ThrottlingException(crate::types::error::ThrottlingException),
20    /// The Extension needs a newer version of AWS Cloud Extensions. Upgrade it, or use an earlier version of the Extension.
21    UpgradeRequiredException(crate::types::error::UpgradeRequiredException),
22    /// 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.
23    ValidationException(crate::types::error::ValidationException),
24    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
25    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
26    variable wildcard pattern and check `.code()`:
27     \
28       `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
29     \
30    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
31    Unhandled(crate::error::sealed_unhandled::Unhandled),
32}
33impl ::std::fmt::Display for Error {
34    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35        match self {
36            Error::AccessDeniedException(inner) => inner.fmt(f),
37            Error::BadGatewayException(inner) => inner.fmt(f),
38            Error::InternalServerException(inner) => inner.fmt(f),
39            Error::LoopDetectedException(inner) => inner.fmt(f),
40            Error::RequestEntityTooLargeException(inner) => inner.fmt(f),
41            Error::ServiceUnavailableException(inner) => inner.fmt(f),
42            Error::ThrottlingException(inner) => inner.fmt(f),
43            Error::UpgradeRequiredException(inner) => inner.fmt(f),
44            Error::ValidationException(inner) => inner.fmt(f),
45            Error::Unhandled(_) => {
46                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
47                    write!(f, "unhandled error ({code})")
48                } else {
49                    f.write_str("unhandled error")
50                }
51            }
52        }
53    }
54}
55impl From<::aws_smithy_types::error::operation::BuildError> for Error {
56    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
57        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
58            source: value.into(),
59            meta: ::std::default::Default::default(),
60        })
61    }
62}
63impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
64    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
65        match self {
66            Self::AccessDeniedException(inner) => inner.meta(),
67            Self::BadGatewayException(inner) => inner.meta(),
68            Self::InternalServerException(inner) => inner.meta(),
69            Self::LoopDetectedException(inner) => inner.meta(),
70            Self::RequestEntityTooLargeException(inner) => inner.meta(),
71            Self::ServiceUnavailableException(inner) => inner.meta(),
72            Self::ThrottlingException(inner) => inner.meta(),
73            Self::UpgradeRequiredException(inner) => inner.meta(),
74            Self::ValidationException(inner) => inner.meta(),
75            Self::Unhandled(inner) => &inner.meta,
76        }
77    }
78}
79impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_configuration::GetConfigurationError, R>> for Error
80where
81    R: Send + Sync + std::fmt::Debug + 'static,
82{
83    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_configuration::GetConfigurationError, R>) -> Self {
84        match err {
85            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
86            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
87                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
88                source: err.into(),
89            }),
90        }
91    }
92}
93impl From<crate::operation::get_configuration::GetConfigurationError> for Error {
94    fn from(err: crate::operation::get_configuration::GetConfigurationError) -> Self {
95        match err {
96            crate::operation::get_configuration::GetConfigurationError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
97            crate::operation::get_configuration::GetConfigurationError::BadGatewayException(inner) => Error::BadGatewayException(inner),
98            crate::operation::get_configuration::GetConfigurationError::InternalServerException(inner) => Error::InternalServerException(inner),
99            crate::operation::get_configuration::GetConfigurationError::LoopDetectedException(inner) => Error::LoopDetectedException(inner),
100            crate::operation::get_configuration::GetConfigurationError::RequestEntityTooLargeException(inner) => {
101                Error::RequestEntityTooLargeException(inner)
102            }
103            crate::operation::get_configuration::GetConfigurationError::ServiceUnavailableException(inner) => {
104                Error::ServiceUnavailableException(inner)
105            }
106            crate::operation::get_configuration::GetConfigurationError::ThrottlingException(inner) => Error::ThrottlingException(inner),
107            crate::operation::get_configuration::GetConfigurationError::UpgradeRequiredException(inner) => Error::UpgradeRequiredException(inner),
108            crate::operation::get_configuration::GetConfigurationError::ValidationException(inner) => Error::ValidationException(inner),
109            crate::operation::get_configuration::GetConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
110        }
111    }
112}
113impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_flag::GetFlagError, R>> for Error
114where
115    R: Send + Sync + std::fmt::Debug + 'static,
116{
117    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_flag::GetFlagError, R>) -> Self {
118        match err {
119            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
120            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
121                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
122                source: err.into(),
123            }),
124        }
125    }
126}
127impl From<crate::operation::get_flag::GetFlagError> for Error {
128    fn from(err: crate::operation::get_flag::GetFlagError) -> Self {
129        match err {
130            crate::operation::get_flag::GetFlagError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
131            crate::operation::get_flag::GetFlagError::BadGatewayException(inner) => Error::BadGatewayException(inner),
132            crate::operation::get_flag::GetFlagError::InternalServerException(inner) => Error::InternalServerException(inner),
133            crate::operation::get_flag::GetFlagError::LoopDetectedException(inner) => Error::LoopDetectedException(inner),
134            crate::operation::get_flag::GetFlagError::RequestEntityTooLargeException(inner) => Error::RequestEntityTooLargeException(inner),
135            crate::operation::get_flag::GetFlagError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
136            crate::operation::get_flag::GetFlagError::ThrottlingException(inner) => Error::ThrottlingException(inner),
137            crate::operation::get_flag::GetFlagError::UpgradeRequiredException(inner) => Error::UpgradeRequiredException(inner),
138            crate::operation::get_flag::GetFlagError::ValidationException(inner) => Error::ValidationException(inner),
139            crate::operation::get_flag::GetFlagError::Unhandled(inner) => Error::Unhandled(inner),
140        }
141    }
142}
143impl ::std::error::Error for Error {
144    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
145        match self {
146            Error::AccessDeniedException(inner) => inner.source(),
147            Error::BadGatewayException(inner) => inner.source(),
148            Error::InternalServerException(inner) => inner.source(),
149            Error::LoopDetectedException(inner) => inner.source(),
150            Error::RequestEntityTooLargeException(inner) => inner.source(),
151            Error::ServiceUnavailableException(inner) => inner.source(),
152            Error::ThrottlingException(inner) => inner.source(),
153            Error::UpgradeRequiredException(inner) => inner.source(),
154            Error::ValidationException(inner) => inner.source(),
155            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
156        }
157    }
158}
159impl ::aws_types::request_id::RequestId for Error {
160    fn request_id(&self) -> Option<&str> {
161        match self {
162            Self::AccessDeniedException(e) => e.request_id(),
163            Self::BadGatewayException(e) => e.request_id(),
164            Self::InternalServerException(e) => e.request_id(),
165            Self::LoopDetectedException(e) => e.request_id(),
166            Self::RequestEntityTooLargeException(e) => e.request_id(),
167            Self::ServiceUnavailableException(e) => e.request_id(),
168            Self::ThrottlingException(e) => e.request_id(),
169            Self::UpgradeRequiredException(e) => e.request_id(),
170            Self::ValidationException(e) => e.request_id(),
171            Self::Unhandled(e) => e.meta.request_id(),
172        }
173    }
174}