aws_sdk_evs/
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    /// <p>A service resource associated with the request could not be found. The resource might not be specified correctly, or it may have a <code>state</code> of <code>DELETED</code>.</p>
7    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
8    /// <p>The number of one or more Amazon EVS resources exceeds the maximum allowed. For a list of Amazon EVS quotas, see <a href="https://docs.aws.amazon.com/evs/latest/userguide/service-quotas-evs.html">Amazon EVS endpoints and quotas</a> in the <i>Amazon EVS User Guide</i>. Delete some resources or request an increase in your service quota. To request an increase, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html">Amazon Web Services Service Quotas</a> in the <i>Amazon Web Services General Reference Guide</i>.</p>
9    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
10    /// <note>
11    /// <p><code>TagPolicyException</code> is deprecated. See <a href="https://docs.aws.amazon.com/evs/latest/APIReference/API_ValidationException.html"> <code>ValidationException</code> </a> instead.</p>
12    /// </note>
13    /// <p>The request doesn't comply with IAM tag policy. Correct your request and then retry it.</p>
14    TagPolicyException(crate::types::error::TagPolicyException),
15    /// <p>The operation couldn't be performed because the service is throttling requests. This exception is thrown when there are too many requests accepted concurrently from the service endpoint.</p>
16    ThrottlingException(crate::types::error::ThrottlingException),
17    /// <note>
18    /// <p><code>TooManyTagsException</code> is deprecated. See <a href="https://docs.aws.amazon.com/evs/latest/APIReference/API_ServiceQuotaExceededException.html"> <code>ServiceQuotaExceededException</code> </a> instead.</p>
19    /// </note>
20    /// <p>A service resource associated with the request has more than 200 tags.</p>
21    TooManyTagsException(crate::types::error::TooManyTagsException),
22    /// <p>The input fails to satisfy the specified constraints. You will see this exception if invalid inputs are provided for any of the Amazon EVS environment operations, or if a list operation is performed on an environment resource that is still initializing.</p>
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    &nbsp;&nbsp;&nbsp;`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::ResourceNotFoundException(inner) => inner.fmt(f),
37            Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
38            Error::TagPolicyException(inner) => inner.fmt(f),
39            Error::ThrottlingException(inner) => inner.fmt(f),
40            Error::TooManyTagsException(inner) => inner.fmt(f),
41            Error::ValidationException(inner) => inner.fmt(f),
42            Error::Unhandled(_) => {
43                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
44                    write!(f, "unhandled error ({code})")
45                } else {
46                    f.write_str("unhandled error")
47                }
48            }
49        }
50    }
51}
52impl From<::aws_smithy_types::error::operation::BuildError> for Error {
53    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
54        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
55            source: value.into(),
56            meta: ::std::default::Default::default(),
57        })
58    }
59}
60impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
61    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
62        match self {
63            Self::ResourceNotFoundException(inner) => inner.meta(),
64            Self::ServiceQuotaExceededException(inner) => inner.meta(),
65            Self::TagPolicyException(inner) => inner.meta(),
66            Self::ThrottlingException(inner) => inner.meta(),
67            Self::TooManyTagsException(inner) => inner.meta(),
68            Self::ValidationException(inner) => inner.meta(),
69            Self::Unhandled(inner) => &inner.meta,
70        }
71    }
72}
73impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_eip_to_vlan::AssociateEipToVlanError, R>> for Error
74where
75    R: Send + Sync + std::fmt::Debug + 'static,
76{
77    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_eip_to_vlan::AssociateEipToVlanError, R>) -> Self {
78        match err {
79            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
80            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
81                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
82                source: err.into(),
83            }),
84        }
85    }
86}
87impl From<crate::operation::associate_eip_to_vlan::AssociateEipToVlanError> for Error {
88    fn from(err: crate::operation::associate_eip_to_vlan::AssociateEipToVlanError) -> Self {
89        match err {
90            crate::operation::associate_eip_to_vlan::AssociateEipToVlanError::ResourceNotFoundException(inner) => {
91                Error::ResourceNotFoundException(inner)
92            }
93            crate::operation::associate_eip_to_vlan::AssociateEipToVlanError::ThrottlingException(inner) => Error::ThrottlingException(inner),
94            crate::operation::associate_eip_to_vlan::AssociateEipToVlanError::ValidationException(inner) => Error::ValidationException(inner),
95            crate::operation::associate_eip_to_vlan::AssociateEipToVlanError::Unhandled(inner) => Error::Unhandled(inner),
96        }
97    }
98}
99impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_environment::CreateEnvironmentError, R>> for Error
100where
101    R: Send + Sync + std::fmt::Debug + 'static,
102{
103    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_environment::CreateEnvironmentError, R>) -> Self {
104        match err {
105            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
106            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
107                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
108                source: err.into(),
109            }),
110        }
111    }
112}
113impl From<crate::operation::create_environment::CreateEnvironmentError> for Error {
114    fn from(err: crate::operation::create_environment::CreateEnvironmentError) -> Self {
115        match err {
116            crate::operation::create_environment::CreateEnvironmentError::ValidationException(inner) => Error::ValidationException(inner),
117            crate::operation::create_environment::CreateEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
118        }
119    }
120}
121impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_environment_host::CreateEnvironmentHostError, R>> for Error
122where
123    R: Send + Sync + std::fmt::Debug + 'static,
124{
125    fn from(
126        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_environment_host::CreateEnvironmentHostError, R>,
127    ) -> Self {
128        match err {
129            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
130            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
131                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
132                source: err.into(),
133            }),
134        }
135    }
136}
137impl From<crate::operation::create_environment_host::CreateEnvironmentHostError> for Error {
138    fn from(err: crate::operation::create_environment_host::CreateEnvironmentHostError) -> Self {
139        match err {
140            crate::operation::create_environment_host::CreateEnvironmentHostError::ThrottlingException(inner) => Error::ThrottlingException(inner),
141            crate::operation::create_environment_host::CreateEnvironmentHostError::ValidationException(inner) => Error::ValidationException(inner),
142            crate::operation::create_environment_host::CreateEnvironmentHostError::Unhandled(inner) => Error::Unhandled(inner),
143        }
144    }
145}
146impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_environment::DeleteEnvironmentError, R>> for Error
147where
148    R: Send + Sync + std::fmt::Debug + 'static,
149{
150    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_environment::DeleteEnvironmentError, R>) -> Self {
151        match err {
152            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
153            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
154                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
155                source: err.into(),
156            }),
157        }
158    }
159}
160impl From<crate::operation::delete_environment::DeleteEnvironmentError> for Error {
161    fn from(err: crate::operation::delete_environment::DeleteEnvironmentError) -> Self {
162        match err {
163            crate::operation::delete_environment::DeleteEnvironmentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
164            crate::operation::delete_environment::DeleteEnvironmentError::ValidationException(inner) => Error::ValidationException(inner),
165            crate::operation::delete_environment::DeleteEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
166        }
167    }
168}
169impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_environment_host::DeleteEnvironmentHostError, R>> for Error
170where
171    R: Send + Sync + std::fmt::Debug + 'static,
172{
173    fn from(
174        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_environment_host::DeleteEnvironmentHostError, R>,
175    ) -> Self {
176        match err {
177            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
178            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
179                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
180                source: err.into(),
181            }),
182        }
183    }
184}
185impl From<crate::operation::delete_environment_host::DeleteEnvironmentHostError> for Error {
186    fn from(err: crate::operation::delete_environment_host::DeleteEnvironmentHostError) -> Self {
187        match err {
188            crate::operation::delete_environment_host::DeleteEnvironmentHostError::ResourceNotFoundException(inner) => {
189                Error::ResourceNotFoundException(inner)
190            }
191            crate::operation::delete_environment_host::DeleteEnvironmentHostError::ValidationException(inner) => Error::ValidationException(inner),
192            crate::operation::delete_environment_host::DeleteEnvironmentHostError::Unhandled(inner) => Error::Unhandled(inner),
193        }
194    }
195}
196impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError, R>>
197    for Error
198where
199    R: Send + Sync + std::fmt::Debug + 'static,
200{
201    fn from(
202        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError, R>,
203    ) -> Self {
204        match err {
205            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
206            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
207                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
208                source: err.into(),
209            }),
210        }
211    }
212}
213impl From<crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError> for Error {
214    fn from(err: crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError) -> Self {
215        match err {
216            crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError::ResourceNotFoundException(inner) => {
217                Error::ResourceNotFoundException(inner)
218            }
219            crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError::ThrottlingException(inner) => {
220                Error::ThrottlingException(inner)
221            }
222            crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError::ValidationException(inner) => {
223                Error::ValidationException(inner)
224            }
225            crate::operation::disassociate_eip_from_vlan::DisassociateEipFromVlanError::Unhandled(inner) => Error::Unhandled(inner),
226        }
227    }
228}
229impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_environment::GetEnvironmentError, R>> for Error
230where
231    R: Send + Sync + std::fmt::Debug + 'static,
232{
233    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_environment::GetEnvironmentError, R>) -> Self {
234        match err {
235            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
236            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
237                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
238                source: err.into(),
239            }),
240        }
241    }
242}
243impl From<crate::operation::get_environment::GetEnvironmentError> for Error {
244    fn from(err: crate::operation::get_environment::GetEnvironmentError) -> Self {
245        match err {
246            crate::operation::get_environment::GetEnvironmentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
247            crate::operation::get_environment::GetEnvironmentError::ValidationException(inner) => Error::ValidationException(inner),
248            crate::operation::get_environment::GetEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
249        }
250    }
251}
252impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_environment_hosts::ListEnvironmentHostsError, R>> for Error
253where
254    R: Send + Sync + std::fmt::Debug + 'static,
255{
256    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_environment_hosts::ListEnvironmentHostsError, R>) -> Self {
257        match err {
258            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
259            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
260                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
261                source: err.into(),
262            }),
263        }
264    }
265}
266impl From<crate::operation::list_environment_hosts::ListEnvironmentHostsError> for Error {
267    fn from(err: crate::operation::list_environment_hosts::ListEnvironmentHostsError) -> Self {
268        match err {
269            crate::operation::list_environment_hosts::ListEnvironmentHostsError::ResourceNotFoundException(inner) => {
270                Error::ResourceNotFoundException(inner)
271            }
272            crate::operation::list_environment_hosts::ListEnvironmentHostsError::ValidationException(inner) => Error::ValidationException(inner),
273            crate::operation::list_environment_hosts::ListEnvironmentHostsError::Unhandled(inner) => Error::Unhandled(inner),
274        }
275    }
276}
277impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_environments::ListEnvironmentsError, R>> for Error
278where
279    R: Send + Sync + std::fmt::Debug + 'static,
280{
281    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_environments::ListEnvironmentsError, R>) -> Self {
282        match err {
283            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
284            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
285                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
286                source: err.into(),
287            }),
288        }
289    }
290}
291impl From<crate::operation::list_environments::ListEnvironmentsError> for Error {
292    fn from(err: crate::operation::list_environments::ListEnvironmentsError) -> Self {
293        match err {
294            crate::operation::list_environments::ListEnvironmentsError::ValidationException(inner) => Error::ValidationException(inner),
295            crate::operation::list_environments::ListEnvironmentsError::Unhandled(inner) => Error::Unhandled(inner),
296        }
297    }
298}
299impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_environment_vlans::ListEnvironmentVlansError, R>> for Error
300where
301    R: Send + Sync + std::fmt::Debug + 'static,
302{
303    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_environment_vlans::ListEnvironmentVlansError, R>) -> Self {
304        match err {
305            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
306            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
307                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
308                source: err.into(),
309            }),
310        }
311    }
312}
313impl From<crate::operation::list_environment_vlans::ListEnvironmentVlansError> for Error {
314    fn from(err: crate::operation::list_environment_vlans::ListEnvironmentVlansError) -> Self {
315        match err {
316            crate::operation::list_environment_vlans::ListEnvironmentVlansError::ResourceNotFoundException(inner) => {
317                Error::ResourceNotFoundException(inner)
318            }
319            crate::operation::list_environment_vlans::ListEnvironmentVlansError::ValidationException(inner) => Error::ValidationException(inner),
320            crate::operation::list_environment_vlans::ListEnvironmentVlansError::Unhandled(inner) => Error::Unhandled(inner),
321        }
322    }
323}
324impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
325where
326    R: Send + Sync + std::fmt::Debug + 'static,
327{
328    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
329        match err {
330            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
331            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
332                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
333                source: err.into(),
334            }),
335        }
336    }
337}
338impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
339    fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
340        match err {
341            crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
342                Error::ResourceNotFoundException(inner)
343            }
344            crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
345        }
346    }
347}
348impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
349where
350    R: Send + Sync + std::fmt::Debug + 'static,
351{
352    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
353        match err {
354            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
355            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
356                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
357                source: err.into(),
358            }),
359        }
360    }
361}
362impl From<crate::operation::tag_resource::TagResourceError> for Error {
363    fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
364        match err {
365            crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
366            crate::operation::tag_resource::TagResourceError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
367            crate::operation::tag_resource::TagResourceError::TagPolicyException(inner) => Error::TagPolicyException(inner),
368            crate::operation::tag_resource::TagResourceError::TooManyTagsException(inner) => Error::TooManyTagsException(inner),
369            crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
370        }
371    }
372}
373impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
374where
375    R: Send + Sync + std::fmt::Debug + 'static,
376{
377    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
378        match err {
379            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
380            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
381                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
382                source: err.into(),
383            }),
384        }
385    }
386}
387impl From<crate::operation::untag_resource::UntagResourceError> for Error {
388    fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
389        match err {
390            crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
391            crate::operation::untag_resource::UntagResourceError::TagPolicyException(inner) => Error::TagPolicyException(inner),
392            crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
393        }
394    }
395}
396impl ::std::error::Error for Error {
397    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
398        match self {
399            Error::ResourceNotFoundException(inner) => inner.source(),
400            Error::ServiceQuotaExceededException(inner) => inner.source(),
401            Error::TagPolicyException(inner) => inner.source(),
402            Error::ThrottlingException(inner) => inner.source(),
403            Error::TooManyTagsException(inner) => inner.source(),
404            Error::ValidationException(inner) => inner.source(),
405            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
406        }
407    }
408}
409impl ::aws_types::request_id::RequestId for Error {
410    fn request_id(&self) -> Option<&str> {
411        match self {
412            Self::ResourceNotFoundException(e) => e.request_id(),
413            Self::ServiceQuotaExceededException(e) => e.request_id(),
414            Self::TagPolicyException(e) => e.request_id(),
415            Self::ThrottlingException(e) => e.request_id(),
416            Self::TooManyTagsException(e) => e.request_id(),
417            Self::ValidationException(e) => e.request_id(),
418            Self::Unhandled(e) => e.meta.request_id(),
419        }
420    }
421}