Skip to main content

aws_sdk_elementalinference/
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>You do not have sufficient access to perform this action.</p>
7    AccessDeniedException(crate::types::error::AccessDeniedException),
8    /// <p>The request could not be completed due to a conflict.</p>
9    ConflictException(crate::types::error::ConflictException),
10    /// <p>An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support.</p>
11    InternalServerErrorException(crate::types::error::InternalServerErrorException),
12    /// <p>The resource specified in the action doesn't exist.</p>
13    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
14    /// <p>The request was rejected because it would exceed one or more service quotas for your account. Review your service quotas and either delete unused resources or request a quota increase.</p>
15    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
16    /// <p>The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying.</p>
17    TooManyRequestException(crate::types::error::TooManyRequestException),
18    /// <p>The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying.</p>
19    ValidationException(crate::types::error::ValidationException),
20    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
21    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
22    variable wildcard pattern and check `.code()`:
23     \
24    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
25     \
26    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
27    Unhandled(crate::error::sealed_unhandled::Unhandled),
28}
29impl ::std::fmt::Display for Error {
30    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31        match self {
32            Error::AccessDeniedException(inner) => inner.fmt(f),
33            Error::ConflictException(inner) => inner.fmt(f),
34            Error::InternalServerErrorException(inner) => inner.fmt(f),
35            Error::ResourceNotFoundException(inner) => inner.fmt(f),
36            Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
37            Error::TooManyRequestException(inner) => inner.fmt(f),
38            Error::ValidationException(inner) => inner.fmt(f),
39            Error::Unhandled(_) => {
40                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
41                    write!(f, "unhandled error ({code})")
42                } else {
43                    f.write_str("unhandled error")
44                }
45            }
46        }
47    }
48}
49impl From<::aws_smithy_types::error::operation::BuildError> for Error {
50    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
51        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
52            source: value.into(),
53            meta: ::std::default::Default::default(),
54        })
55    }
56}
57impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
58    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
59        match self {
60            Self::AccessDeniedException(inner) => inner.meta(),
61            Self::ConflictException(inner) => inner.meta(),
62            Self::InternalServerErrorException(inner) => inner.meta(),
63            Self::ResourceNotFoundException(inner) => inner.meta(),
64            Self::ServiceQuotaExceededException(inner) => inner.meta(),
65            Self::TooManyRequestException(inner) => inner.meta(),
66            Self::ValidationException(inner) => inner.meta(),
67            Self::Unhandled(inner) => &inner.meta,
68        }
69    }
70}
71impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_feed::AssociateFeedError, R>> for Error
72where
73    R: Send + Sync + std::fmt::Debug + 'static,
74{
75    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_feed::AssociateFeedError, R>) -> Self {
76        match err {
77            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
78            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
79                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
80                source: err.into(),
81            }),
82        }
83    }
84}
85impl From<crate::operation::associate_feed::AssociateFeedError> for Error {
86    fn from(err: crate::operation::associate_feed::AssociateFeedError) -> Self {
87        match err {
88            crate::operation::associate_feed::AssociateFeedError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
89            crate::operation::associate_feed::AssociateFeedError::ConflictException(inner) => Error::ConflictException(inner),
90            crate::operation::associate_feed::AssociateFeedError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
91            crate::operation::associate_feed::AssociateFeedError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
92            crate::operation::associate_feed::AssociateFeedError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
93            crate::operation::associate_feed::AssociateFeedError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
94            crate::operation::associate_feed::AssociateFeedError::ValidationException(inner) => Error::ValidationException(inner),
95            crate::operation::associate_feed::AssociateFeedError::Unhandled(inner) => Error::Unhandled(inner),
96        }
97    }
98}
99impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_feed::CreateFeedError, 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_feed::CreateFeedError, 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_feed::CreateFeedError> for Error {
114    fn from(err: crate::operation::create_feed::CreateFeedError) -> Self {
115        match err {
116            crate::operation::create_feed::CreateFeedError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
117            crate::operation::create_feed::CreateFeedError::ConflictException(inner) => Error::ConflictException(inner),
118            crate::operation::create_feed::CreateFeedError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
119            crate::operation::create_feed::CreateFeedError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
120            crate::operation::create_feed::CreateFeedError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
121            crate::operation::create_feed::CreateFeedError::ValidationException(inner) => Error::ValidationException(inner),
122            crate::operation::create_feed::CreateFeedError::Unhandled(inner) => Error::Unhandled(inner),
123        }
124    }
125}
126impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_feed::DeleteFeedError, R>> for Error
127where
128    R: Send + Sync + std::fmt::Debug + 'static,
129{
130    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_feed::DeleteFeedError, R>) -> Self {
131        match err {
132            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
133            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
134                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
135                source: err.into(),
136            }),
137        }
138    }
139}
140impl From<crate::operation::delete_feed::DeleteFeedError> for Error {
141    fn from(err: crate::operation::delete_feed::DeleteFeedError) -> Self {
142        match err {
143            crate::operation::delete_feed::DeleteFeedError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
144            crate::operation::delete_feed::DeleteFeedError::ConflictException(inner) => Error::ConflictException(inner),
145            crate::operation::delete_feed::DeleteFeedError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
146            crate::operation::delete_feed::DeleteFeedError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
147            crate::operation::delete_feed::DeleteFeedError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
148            crate::operation::delete_feed::DeleteFeedError::ValidationException(inner) => Error::ValidationException(inner),
149            crate::operation::delete_feed::DeleteFeedError::Unhandled(inner) => Error::Unhandled(inner),
150        }
151    }
152}
153impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_feed::DisassociateFeedError, R>> for Error
154where
155    R: Send + Sync + std::fmt::Debug + 'static,
156{
157    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_feed::DisassociateFeedError, R>) -> Self {
158        match err {
159            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
160            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
161                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
162                source: err.into(),
163            }),
164        }
165    }
166}
167impl From<crate::operation::disassociate_feed::DisassociateFeedError> for Error {
168    fn from(err: crate::operation::disassociate_feed::DisassociateFeedError) -> Self {
169        match err {
170            crate::operation::disassociate_feed::DisassociateFeedError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
171            crate::operation::disassociate_feed::DisassociateFeedError::ConflictException(inner) => Error::ConflictException(inner),
172            crate::operation::disassociate_feed::DisassociateFeedError::InternalServerErrorException(inner) => {
173                Error::InternalServerErrorException(inner)
174            }
175            crate::operation::disassociate_feed::DisassociateFeedError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
176            crate::operation::disassociate_feed::DisassociateFeedError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
177            crate::operation::disassociate_feed::DisassociateFeedError::ValidationException(inner) => Error::ValidationException(inner),
178            crate::operation::disassociate_feed::DisassociateFeedError::Unhandled(inner) => Error::Unhandled(inner),
179        }
180    }
181}
182impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_feed::GetFeedError, R>> for Error
183where
184    R: Send + Sync + std::fmt::Debug + 'static,
185{
186    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_feed::GetFeedError, R>) -> Self {
187        match err {
188            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
189            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
190                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
191                source: err.into(),
192            }),
193        }
194    }
195}
196impl From<crate::operation::get_feed::GetFeedError> for Error {
197    fn from(err: crate::operation::get_feed::GetFeedError) -> Self {
198        match err {
199            crate::operation::get_feed::GetFeedError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
200            crate::operation::get_feed::GetFeedError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
201            crate::operation::get_feed::GetFeedError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
202            crate::operation::get_feed::GetFeedError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
203            crate::operation::get_feed::GetFeedError::Unhandled(inner) => Error::Unhandled(inner),
204        }
205    }
206}
207impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_feeds::ListFeedsError, R>> for Error
208where
209    R: Send + Sync + std::fmt::Debug + 'static,
210{
211    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_feeds::ListFeedsError, R>) -> Self {
212        match err {
213            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
214            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
215                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
216                source: err.into(),
217            }),
218        }
219    }
220}
221impl From<crate::operation::list_feeds::ListFeedsError> for Error {
222    fn from(err: crate::operation::list_feeds::ListFeedsError) -> Self {
223        match err {
224            crate::operation::list_feeds::ListFeedsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
225            crate::operation::list_feeds::ListFeedsError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
226            crate::operation::list_feeds::ListFeedsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
227            crate::operation::list_feeds::ListFeedsError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
228            crate::operation::list_feeds::ListFeedsError::ValidationException(inner) => Error::ValidationException(inner),
229            crate::operation::list_feeds::ListFeedsError::Unhandled(inner) => Error::Unhandled(inner),
230        }
231    }
232}
233impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
234where
235    R: Send + Sync + std::fmt::Debug + 'static,
236{
237    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
238        match err {
239            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
240            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
241                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
242                source: err.into(),
243            }),
244        }
245    }
246}
247impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
248    fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
249        match err {
250            crate::operation::list_tags_for_resource::ListTagsForResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
251            crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerErrorException(inner) => {
252                Error::InternalServerErrorException(inner)
253            }
254            crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
255                Error::ResourceNotFoundException(inner)
256            }
257            crate::operation::list_tags_for_resource::ListTagsForResourceError::TooManyRequestException(inner) => {
258                Error::TooManyRequestException(inner)
259            }
260            crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
261            crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
262        }
263    }
264}
265impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
266where
267    R: Send + Sync + std::fmt::Debug + 'static,
268{
269    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
270        match err {
271            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
272            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
273                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
274                source: err.into(),
275            }),
276        }
277    }
278}
279impl From<crate::operation::tag_resource::TagResourceError> for Error {
280    fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
281        match err {
282            crate::operation::tag_resource::TagResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
283            crate::operation::tag_resource::TagResourceError::ConflictException(inner) => Error::ConflictException(inner),
284            crate::operation::tag_resource::TagResourceError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
285            crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
286            crate::operation::tag_resource::TagResourceError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
287            crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
288            crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
289        }
290    }
291}
292impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
293where
294    R: Send + Sync + std::fmt::Debug + 'static,
295{
296    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
297        match err {
298            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
299            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
300                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
301                source: err.into(),
302            }),
303        }
304    }
305}
306impl From<crate::operation::untag_resource::UntagResourceError> for Error {
307    fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
308        match err {
309            crate::operation::untag_resource::UntagResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
310            crate::operation::untag_resource::UntagResourceError::ConflictException(inner) => Error::ConflictException(inner),
311            crate::operation::untag_resource::UntagResourceError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
312            crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
313            crate::operation::untag_resource::UntagResourceError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
314            crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
315            crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
316        }
317    }
318}
319impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_feed::UpdateFeedError, R>> for Error
320where
321    R: Send + Sync + std::fmt::Debug + 'static,
322{
323    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_feed::UpdateFeedError, R>) -> Self {
324        match err {
325            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
326            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
327                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
328                source: err.into(),
329            }),
330        }
331    }
332}
333impl From<crate::operation::update_feed::UpdateFeedError> for Error {
334    fn from(err: crate::operation::update_feed::UpdateFeedError) -> Self {
335        match err {
336            crate::operation::update_feed::UpdateFeedError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
337            crate::operation::update_feed::UpdateFeedError::ConflictException(inner) => Error::ConflictException(inner),
338            crate::operation::update_feed::UpdateFeedError::InternalServerErrorException(inner) => Error::InternalServerErrorException(inner),
339            crate::operation::update_feed::UpdateFeedError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
340            crate::operation::update_feed::UpdateFeedError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
341            crate::operation::update_feed::UpdateFeedError::TooManyRequestException(inner) => Error::TooManyRequestException(inner),
342            crate::operation::update_feed::UpdateFeedError::ValidationException(inner) => Error::ValidationException(inner),
343            crate::operation::update_feed::UpdateFeedError::Unhandled(inner) => Error::Unhandled(inner),
344        }
345    }
346}
347impl<O, E> ::std::convert::From<::aws_smithy_runtime_api::client::waiters::error::WaiterError<O, E>> for Error
348where
349    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
350    E: ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static,
351{
352    fn from(err: ::aws_smithy_runtime_api::client::waiters::error::WaiterError<O, E>) -> Self {
353        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
354            meta: ::std::default::Default::default(),
355            source: err.into(),
356        })
357    }
358}
359impl ::std::error::Error for Error {
360    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
361        match self {
362            Error::AccessDeniedException(inner) => inner.source(),
363            Error::ConflictException(inner) => inner.source(),
364            Error::InternalServerErrorException(inner) => inner.source(),
365            Error::ResourceNotFoundException(inner) => inner.source(),
366            Error::ServiceQuotaExceededException(inner) => inner.source(),
367            Error::TooManyRequestException(inner) => inner.source(),
368            Error::ValidationException(inner) => inner.source(),
369            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
370        }
371    }
372}
373impl ::aws_types::request_id::RequestId for Error {
374    fn request_id(&self) -> Option<&str> {
375        match self {
376            Self::AccessDeniedException(e) => e.request_id(),
377            Self::ConflictException(e) => e.request_id(),
378            Self::InternalServerErrorException(e) => e.request_id(),
379            Self::ResourceNotFoundException(e) => e.request_id(),
380            Self::ServiceQuotaExceededException(e) => e.request_id(),
381            Self::TooManyRequestException(e) => e.request_id(),
382            Self::ValidationException(e) => e.request_id(),
383            Self::Unhandled(e) => e.meta.request_id(),
384        }
385    }
386}