1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 InternalServerException(crate::types::error::InternalServerException),
8 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
10 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
12 ThrottlingException(crate::types::error::ThrottlingException),
14 ValidationException(crate::types::error::ValidationException),
16 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
18 variable wildcard pattern and check `.code()`:
19 \
20 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
21 \
22 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
23 Unhandled(crate::error::sealed_unhandled::Unhandled),
24}
25impl ::std::fmt::Display for Error {
26 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27 match self {
28 Error::InternalServerException(inner) => inner.fmt(f),
29 Error::ResourceNotFoundException(inner) => inner.fmt(f),
30 Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
31 Error::ThrottlingException(inner) => inner.fmt(f),
32 Error::ValidationException(inner) => inner.fmt(f),
33 Error::Unhandled(_) => {
34 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
35 write!(f, "unhandled error ({code})")
36 } else {
37 f.write_str("unhandled error")
38 }
39 }
40 }
41 }
42}
43impl From<::aws_smithy_types::error::operation::BuildError> for Error {
44 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
45 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
46 source: value.into(),
47 meta: ::std::default::Default::default(),
48 })
49 }
50}
51impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
52 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
53 match self {
54 Self::InternalServerException(inner) => inner.meta(),
55 Self::ResourceNotFoundException(inner) => inner.meta(),
56 Self::ServiceQuotaExceededException(inner) => inner.meta(),
57 Self::ThrottlingException(inner) => inner.meta(),
58 Self::ValidationException(inner) => inner.meta(),
59 Self::Unhandled(inner) => &inner.meta,
60 }
61 }
62}
63impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_export::CreateExportError, R>> for Error
64where
65 R: Send + Sync + std::fmt::Debug + 'static,
66{
67 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_export::CreateExportError, R>) -> Self {
68 match err {
69 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
70 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
71 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
72 source: err.into(),
73 }),
74 }
75 }
76}
77impl From<crate::operation::create_export::CreateExportError> for Error {
78 fn from(err: crate::operation::create_export::CreateExportError) -> Self {
79 match err {
80 crate::operation::create_export::CreateExportError::InternalServerException(inner) => Error::InternalServerException(inner),
81 crate::operation::create_export::CreateExportError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
82 crate::operation::create_export::CreateExportError::ThrottlingException(inner) => Error::ThrottlingException(inner),
83 crate::operation::create_export::CreateExportError::ValidationException(inner) => Error::ValidationException(inner),
84 crate::operation::create_export::CreateExportError::Unhandled(inner) => Error::Unhandled(inner),
85 }
86 }
87}
88impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_export::DeleteExportError, R>> for Error
89where
90 R: Send + Sync + std::fmt::Debug + 'static,
91{
92 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_export::DeleteExportError, R>) -> Self {
93 match err {
94 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
95 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
96 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
97 source: err.into(),
98 }),
99 }
100 }
101}
102impl From<crate::operation::delete_export::DeleteExportError> for Error {
103 fn from(err: crate::operation::delete_export::DeleteExportError) -> Self {
104 match err {
105 crate::operation::delete_export::DeleteExportError::InternalServerException(inner) => Error::InternalServerException(inner),
106 crate::operation::delete_export::DeleteExportError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
107 crate::operation::delete_export::DeleteExportError::ThrottlingException(inner) => Error::ThrottlingException(inner),
108 crate::operation::delete_export::DeleteExportError::ValidationException(inner) => Error::ValidationException(inner),
109 crate::operation::delete_export::DeleteExportError::Unhandled(inner) => Error::Unhandled(inner),
110 }
111 }
112}
113impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_execution::GetExecutionError, 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_execution::GetExecutionError, 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_execution::GetExecutionError> for Error {
128 fn from(err: crate::operation::get_execution::GetExecutionError) -> Self {
129 match err {
130 crate::operation::get_execution::GetExecutionError::InternalServerException(inner) => Error::InternalServerException(inner),
131 crate::operation::get_execution::GetExecutionError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
132 crate::operation::get_execution::GetExecutionError::ThrottlingException(inner) => Error::ThrottlingException(inner),
133 crate::operation::get_execution::GetExecutionError::ValidationException(inner) => Error::ValidationException(inner),
134 crate::operation::get_execution::GetExecutionError::Unhandled(inner) => Error::Unhandled(inner),
135 }
136 }
137}
138impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_export::GetExportError, R>> for Error
139where
140 R: Send + Sync + std::fmt::Debug + 'static,
141{
142 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_export::GetExportError, R>) -> Self {
143 match err {
144 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
145 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
146 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
147 source: err.into(),
148 }),
149 }
150 }
151}
152impl From<crate::operation::get_export::GetExportError> for Error {
153 fn from(err: crate::operation::get_export::GetExportError) -> Self {
154 match err {
155 crate::operation::get_export::GetExportError::InternalServerException(inner) => Error::InternalServerException(inner),
156 crate::operation::get_export::GetExportError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
157 crate::operation::get_export::GetExportError::ThrottlingException(inner) => Error::ThrottlingException(inner),
158 crate::operation::get_export::GetExportError::ValidationException(inner) => Error::ValidationException(inner),
159 crate::operation::get_export::GetExportError::Unhandled(inner) => Error::Unhandled(inner),
160 }
161 }
162}
163impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_table::GetTableError, R>> for Error
164where
165 R: Send + Sync + std::fmt::Debug + 'static,
166{
167 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_table::GetTableError, R>) -> Self {
168 match err {
169 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
170 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
171 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
172 source: err.into(),
173 }),
174 }
175 }
176}
177impl From<crate::operation::get_table::GetTableError> for Error {
178 fn from(err: crate::operation::get_table::GetTableError) -> Self {
179 match err {
180 crate::operation::get_table::GetTableError::InternalServerException(inner) => Error::InternalServerException(inner),
181 crate::operation::get_table::GetTableError::ThrottlingException(inner) => Error::ThrottlingException(inner),
182 crate::operation::get_table::GetTableError::ValidationException(inner) => Error::ValidationException(inner),
183 crate::operation::get_table::GetTableError::Unhandled(inner) => Error::Unhandled(inner),
184 }
185 }
186}
187impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_executions::ListExecutionsError, R>> for Error
188where
189 R: Send + Sync + std::fmt::Debug + 'static,
190{
191 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_executions::ListExecutionsError, R>) -> Self {
192 match err {
193 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
194 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
195 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
196 source: err.into(),
197 }),
198 }
199 }
200}
201impl From<crate::operation::list_executions::ListExecutionsError> for Error {
202 fn from(err: crate::operation::list_executions::ListExecutionsError) -> Self {
203 match err {
204 crate::operation::list_executions::ListExecutionsError::InternalServerException(inner) => Error::InternalServerException(inner),
205 crate::operation::list_executions::ListExecutionsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
206 crate::operation::list_executions::ListExecutionsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
207 crate::operation::list_executions::ListExecutionsError::ValidationException(inner) => Error::ValidationException(inner),
208 crate::operation::list_executions::ListExecutionsError::Unhandled(inner) => Error::Unhandled(inner),
209 }
210 }
211}
212impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_exports::ListExportsError, R>> for Error
213where
214 R: Send + Sync + std::fmt::Debug + 'static,
215{
216 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_exports::ListExportsError, R>) -> Self {
217 match err {
218 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
219 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
220 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
221 source: err.into(),
222 }),
223 }
224 }
225}
226impl From<crate::operation::list_exports::ListExportsError> for Error {
227 fn from(err: crate::operation::list_exports::ListExportsError) -> Self {
228 match err {
229 crate::operation::list_exports::ListExportsError::InternalServerException(inner) => Error::InternalServerException(inner),
230 crate::operation::list_exports::ListExportsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
231 crate::operation::list_exports::ListExportsError::ValidationException(inner) => Error::ValidationException(inner),
232 crate::operation::list_exports::ListExportsError::Unhandled(inner) => Error::Unhandled(inner),
233 }
234 }
235}
236impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tables::ListTablesError, R>> for Error
237where
238 R: Send + Sync + std::fmt::Debug + 'static,
239{
240 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tables::ListTablesError, R>) -> Self {
241 match err {
242 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
243 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
244 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
245 source: err.into(),
246 }),
247 }
248 }
249}
250impl From<crate::operation::list_tables::ListTablesError> for Error {
251 fn from(err: crate::operation::list_tables::ListTablesError) -> Self {
252 match err {
253 crate::operation::list_tables::ListTablesError::InternalServerException(inner) => Error::InternalServerException(inner),
254 crate::operation::list_tables::ListTablesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
255 crate::operation::list_tables::ListTablesError::ValidationException(inner) => Error::ValidationException(inner),
256 crate::operation::list_tables::ListTablesError::Unhandled(inner) => Error::Unhandled(inner),
257 }
258 }
259}
260impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
261where
262 R: Send + Sync + std::fmt::Debug + 'static,
263{
264 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
265 match err {
266 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
267 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
268 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
269 source: err.into(),
270 }),
271 }
272 }
273}
274impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
275 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
276 match err {
277 crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => {
278 Error::InternalServerException(inner)
279 }
280 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
281 Error::ResourceNotFoundException(inner)
282 }
283 crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
284 crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
285 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
286 }
287 }
288}
289impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
290where
291 R: Send + Sync + std::fmt::Debug + 'static,
292{
293 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
294 match err {
295 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
296 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
297 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
298 source: err.into(),
299 }),
300 }
301 }
302}
303impl From<crate::operation::tag_resource::TagResourceError> for Error {
304 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
305 match err {
306 crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
307 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
308 crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
309 crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
310 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
311 }
312 }
313}
314impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
315where
316 R: Send + Sync + std::fmt::Debug + 'static,
317{
318 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
319 match err {
320 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
321 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
322 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
323 source: err.into(),
324 }),
325 }
326 }
327}
328impl From<crate::operation::untag_resource::UntagResourceError> for Error {
329 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
330 match err {
331 crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
332 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
333 crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
334 crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
335 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
336 }
337 }
338}
339impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_export::UpdateExportError, R>> for Error
340where
341 R: Send + Sync + std::fmt::Debug + 'static,
342{
343 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_export::UpdateExportError, R>) -> Self {
344 match err {
345 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
346 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
347 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
348 source: err.into(),
349 }),
350 }
351 }
352}
353impl From<crate::operation::update_export::UpdateExportError> for Error {
354 fn from(err: crate::operation::update_export::UpdateExportError) -> Self {
355 match err {
356 crate::operation::update_export::UpdateExportError::InternalServerException(inner) => Error::InternalServerException(inner),
357 crate::operation::update_export::UpdateExportError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
358 crate::operation::update_export::UpdateExportError::ThrottlingException(inner) => Error::ThrottlingException(inner),
359 crate::operation::update_export::UpdateExportError::ValidationException(inner) => Error::ValidationException(inner),
360 crate::operation::update_export::UpdateExportError::Unhandled(inner) => Error::Unhandled(inner),
361 }
362 }
363}
364impl ::std::error::Error for Error {
365 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
366 match self {
367 Error::InternalServerException(inner) => inner.source(),
368 Error::ResourceNotFoundException(inner) => inner.source(),
369 Error::ServiceQuotaExceededException(inner) => inner.source(),
370 Error::ThrottlingException(inner) => inner.source(),
371 Error::ValidationException(inner) => inner.source(),
372 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
373 }
374 }
375}
376impl ::aws_types::request_id::RequestId for Error {
377 fn request_id(&self) -> Option<&str> {
378 match self {
379 Self::InternalServerException(e) => e.request_id(),
380 Self::ResourceNotFoundException(e) => e.request_id(),
381 Self::ServiceQuotaExceededException(e) => e.request_id(),
382 Self::ThrottlingException(e) => e.request_id(),
383 Self::ValidationException(e) => e.request_id(),
384 Self::Unhandled(e) => e.meta.request_id(),
385 }
386 }
387}