1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 InternalServerException(crate::types::error::InternalServerException),
8 InvalidParameterException(crate::types::error::InvalidParameterException),
10 ResourceConflictException(crate::types::error::ResourceConflictException),
12 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
14 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
16 ThrottlingException(crate::types::error::ThrottlingException),
18 UnauthorizedException(crate::types::error::UnauthorizedException),
20 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
22 variable wildcard pattern and check `.code()`:
23 \
24 `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::InternalServerException(inner) => inner.fmt(f),
33 Error::InvalidParameterException(inner) => inner.fmt(f),
34 Error::ResourceConflictException(inner) => inner.fmt(f),
35 Error::ResourceNotFoundException(inner) => inner.fmt(f),
36 Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
37 Error::ThrottlingException(inner) => inner.fmt(f),
38 Error::UnauthorizedException(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::InternalServerException(inner) => inner.meta(),
61 Self::InvalidParameterException(inner) => inner.meta(),
62 Self::ResourceConflictException(inner) => inner.meta(),
63 Self::ResourceNotFoundException(inner) => inner.meta(),
64 Self::ServiceQuotaExceededException(inner) => inner.meta(),
65 Self::ThrottlingException(inner) => inner.meta(),
66 Self::UnauthorizedException(inner) => inner.meta(),
67 Self::Unhandled(inner) => &inner.meta,
68 }
69 }
70}
71impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_component::CreateComponentError, 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::create_component::CreateComponentError, 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::create_component::CreateComponentError> for Error {
86 fn from(err: crate::operation::create_component::CreateComponentError) -> Self {
87 match err {
88 crate::operation::create_component::CreateComponentError::InternalServerException(inner) => Error::InternalServerException(inner),
89 crate::operation::create_component::CreateComponentError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
90 crate::operation::create_component::CreateComponentError::ResourceConflictException(inner) => Error::ResourceConflictException(inner),
91 crate::operation::create_component::CreateComponentError::ServiceQuotaExceededException(inner) => {
92 Error::ServiceQuotaExceededException(inner)
93 }
94 crate::operation::create_component::CreateComponentError::Unhandled(inner) => Error::Unhandled(inner),
95 }
96 }
97}
98impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_form::CreateFormError, R>> for Error
99where
100 R: Send + Sync + std::fmt::Debug + 'static,
101{
102 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_form::CreateFormError, R>) -> Self {
103 match err {
104 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
105 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
106 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
107 source: err.into(),
108 }),
109 }
110 }
111}
112impl From<crate::operation::create_form::CreateFormError> for Error {
113 fn from(err: crate::operation::create_form::CreateFormError) -> Self {
114 match err {
115 crate::operation::create_form::CreateFormError::InternalServerException(inner) => Error::InternalServerException(inner),
116 crate::operation::create_form::CreateFormError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
117 crate::operation::create_form::CreateFormError::ResourceConflictException(inner) => Error::ResourceConflictException(inner),
118 crate::operation::create_form::CreateFormError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
119 crate::operation::create_form::CreateFormError::Unhandled(inner) => Error::Unhandled(inner),
120 }
121 }
122}
123impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_theme::CreateThemeError, R>> for Error
124where
125 R: Send + Sync + std::fmt::Debug + 'static,
126{
127 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_theme::CreateThemeError, R>) -> 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_theme::CreateThemeError> for Error {
138 fn from(err: crate::operation::create_theme::CreateThemeError) -> Self {
139 match err {
140 crate::operation::create_theme::CreateThemeError::InternalServerException(inner) => Error::InternalServerException(inner),
141 crate::operation::create_theme::CreateThemeError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
142 crate::operation::create_theme::CreateThemeError::ResourceConflictException(inner) => Error::ResourceConflictException(inner),
143 crate::operation::create_theme::CreateThemeError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
144 crate::operation::create_theme::CreateThemeError::Unhandled(inner) => Error::Unhandled(inner),
145 }
146 }
147}
148impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_component::DeleteComponentError, R>> for Error
149where
150 R: Send + Sync + std::fmt::Debug + 'static,
151{
152 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_component::DeleteComponentError, R>) -> Self {
153 match err {
154 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
155 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
156 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
157 source: err.into(),
158 }),
159 }
160 }
161}
162impl From<crate::operation::delete_component::DeleteComponentError> for Error {
163 fn from(err: crate::operation::delete_component::DeleteComponentError) -> Self {
164 match err {
165 crate::operation::delete_component::DeleteComponentError::InternalServerException(inner) => Error::InternalServerException(inner),
166 crate::operation::delete_component::DeleteComponentError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
167 crate::operation::delete_component::DeleteComponentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
168 crate::operation::delete_component::DeleteComponentError::Unhandled(inner) => Error::Unhandled(inner),
169 }
170 }
171}
172impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_form::DeleteFormError, R>> for Error
173where
174 R: Send + Sync + std::fmt::Debug + 'static,
175{
176 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_form::DeleteFormError, R>) -> Self {
177 match err {
178 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
179 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
180 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
181 source: err.into(),
182 }),
183 }
184 }
185}
186impl From<crate::operation::delete_form::DeleteFormError> for Error {
187 fn from(err: crate::operation::delete_form::DeleteFormError) -> Self {
188 match err {
189 crate::operation::delete_form::DeleteFormError::InternalServerException(inner) => Error::InternalServerException(inner),
190 crate::operation::delete_form::DeleteFormError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
191 crate::operation::delete_form::DeleteFormError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
192 crate::operation::delete_form::DeleteFormError::Unhandled(inner) => Error::Unhandled(inner),
193 }
194 }
195}
196impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_theme::DeleteThemeError, R>> for Error
197where
198 R: Send + Sync + std::fmt::Debug + 'static,
199{
200 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_theme::DeleteThemeError, R>) -> Self {
201 match err {
202 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
203 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
204 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
205 source: err.into(),
206 }),
207 }
208 }
209}
210impl From<crate::operation::delete_theme::DeleteThemeError> for Error {
211 fn from(err: crate::operation::delete_theme::DeleteThemeError) -> Self {
212 match err {
213 crate::operation::delete_theme::DeleteThemeError::InternalServerException(inner) => Error::InternalServerException(inner),
214 crate::operation::delete_theme::DeleteThemeError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
215 crate::operation::delete_theme::DeleteThemeError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
216 crate::operation::delete_theme::DeleteThemeError::Unhandled(inner) => Error::Unhandled(inner),
217 }
218 }
219}
220impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::exchange_code_for_token::ExchangeCodeForTokenError, R>> for Error
221where
222 R: Send + Sync + std::fmt::Debug + 'static,
223{
224 fn from(
225 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::exchange_code_for_token::ExchangeCodeForTokenError, R>,
226 ) -> Self {
227 match err {
228 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
229 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
230 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
231 source: err.into(),
232 }),
233 }
234 }
235}
236impl From<crate::operation::exchange_code_for_token::ExchangeCodeForTokenError> for Error {
237 fn from(err: crate::operation::exchange_code_for_token::ExchangeCodeForTokenError) -> Self {
238 match err {
239 crate::operation::exchange_code_for_token::ExchangeCodeForTokenError::InvalidParameterException(inner) => {
240 Error::InvalidParameterException(inner)
241 }
242 crate::operation::exchange_code_for_token::ExchangeCodeForTokenError::Unhandled(inner) => Error::Unhandled(inner),
243 }
244 }
245}
246impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_components::ExportComponentsError, R>> for Error
247where
248 R: Send + Sync + std::fmt::Debug + 'static,
249{
250 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_components::ExportComponentsError, R>) -> Self {
251 match err {
252 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
253 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
254 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
255 source: err.into(),
256 }),
257 }
258 }
259}
260impl From<crate::operation::export_components::ExportComponentsError> for Error {
261 fn from(err: crate::operation::export_components::ExportComponentsError) -> Self {
262 match err {
263 crate::operation::export_components::ExportComponentsError::InternalServerException(inner) => Error::InternalServerException(inner),
264 crate::operation::export_components::ExportComponentsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
265 crate::operation::export_components::ExportComponentsError::Unhandled(inner) => Error::Unhandled(inner),
266 }
267 }
268}
269impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_forms::ExportFormsError, R>> for Error
270where
271 R: Send + Sync + std::fmt::Debug + 'static,
272{
273 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_forms::ExportFormsError, R>) -> Self {
274 match err {
275 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
276 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
277 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
278 source: err.into(),
279 }),
280 }
281 }
282}
283impl From<crate::operation::export_forms::ExportFormsError> for Error {
284 fn from(err: crate::operation::export_forms::ExportFormsError) -> Self {
285 match err {
286 crate::operation::export_forms::ExportFormsError::InternalServerException(inner) => Error::InternalServerException(inner),
287 crate::operation::export_forms::ExportFormsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
288 crate::operation::export_forms::ExportFormsError::Unhandled(inner) => Error::Unhandled(inner),
289 }
290 }
291}
292impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_themes::ExportThemesError, 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::export_themes::ExportThemesError, 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::export_themes::ExportThemesError> for Error {
307 fn from(err: crate::operation::export_themes::ExportThemesError) -> Self {
308 match err {
309 crate::operation::export_themes::ExportThemesError::InternalServerException(inner) => Error::InternalServerException(inner),
310 crate::operation::export_themes::ExportThemesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
311 crate::operation::export_themes::ExportThemesError::Unhandled(inner) => Error::Unhandled(inner),
312 }
313 }
314}
315impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_codegen_job::GetCodegenJobError, R>> for Error
316where
317 R: Send + Sync + std::fmt::Debug + 'static,
318{
319 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_codegen_job::GetCodegenJobError, R>) -> Self {
320 match err {
321 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
322 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
323 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
324 source: err.into(),
325 }),
326 }
327 }
328}
329impl From<crate::operation::get_codegen_job::GetCodegenJobError> for Error {
330 fn from(err: crate::operation::get_codegen_job::GetCodegenJobError) -> Self {
331 match err {
332 crate::operation::get_codegen_job::GetCodegenJobError::InternalServerException(inner) => Error::InternalServerException(inner),
333 crate::operation::get_codegen_job::GetCodegenJobError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
334 crate::operation::get_codegen_job::GetCodegenJobError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
335 crate::operation::get_codegen_job::GetCodegenJobError::ThrottlingException(inner) => Error::ThrottlingException(inner),
336 crate::operation::get_codegen_job::GetCodegenJobError::Unhandled(inner) => Error::Unhandled(inner),
337 }
338 }
339}
340impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_component::GetComponentError, R>> for Error
341where
342 R: Send + Sync + std::fmt::Debug + 'static,
343{
344 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_component::GetComponentError, R>) -> Self {
345 match err {
346 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
347 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
348 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
349 source: err.into(),
350 }),
351 }
352 }
353}
354impl From<crate::operation::get_component::GetComponentError> for Error {
355 fn from(err: crate::operation::get_component::GetComponentError) -> Self {
356 match err {
357 crate::operation::get_component::GetComponentError::InternalServerException(inner) => Error::InternalServerException(inner),
358 crate::operation::get_component::GetComponentError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
359 crate::operation::get_component::GetComponentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
360 crate::operation::get_component::GetComponentError::Unhandled(inner) => Error::Unhandled(inner),
361 }
362 }
363}
364impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_form::GetFormError, R>> for Error
365where
366 R: Send + Sync + std::fmt::Debug + 'static,
367{
368 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_form::GetFormError, R>) -> Self {
369 match err {
370 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
371 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
372 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
373 source: err.into(),
374 }),
375 }
376 }
377}
378impl From<crate::operation::get_form::GetFormError> for Error {
379 fn from(err: crate::operation::get_form::GetFormError) -> Self {
380 match err {
381 crate::operation::get_form::GetFormError::InternalServerException(inner) => Error::InternalServerException(inner),
382 crate::operation::get_form::GetFormError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
383 crate::operation::get_form::GetFormError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
384 crate::operation::get_form::GetFormError::Unhandled(inner) => Error::Unhandled(inner),
385 }
386 }
387}
388impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_metadata::GetMetadataError, R>> for Error
389where
390 R: Send + Sync + std::fmt::Debug + 'static,
391{
392 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_metadata::GetMetadataError, R>) -> Self {
393 match err {
394 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
395 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
396 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
397 source: err.into(),
398 }),
399 }
400 }
401}
402impl From<crate::operation::get_metadata::GetMetadataError> for Error {
403 fn from(err: crate::operation::get_metadata::GetMetadataError) -> Self {
404 match err {
405 crate::operation::get_metadata::GetMetadataError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
406 crate::operation::get_metadata::GetMetadataError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
407 crate::operation::get_metadata::GetMetadataError::Unhandled(inner) => Error::Unhandled(inner),
408 }
409 }
410}
411impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_theme::GetThemeError, R>> for Error
412where
413 R: Send + Sync + std::fmt::Debug + 'static,
414{
415 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_theme::GetThemeError, R>) -> Self {
416 match err {
417 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
418 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
419 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
420 source: err.into(),
421 }),
422 }
423 }
424}
425impl From<crate::operation::get_theme::GetThemeError> for Error {
426 fn from(err: crate::operation::get_theme::GetThemeError) -> Self {
427 match err {
428 crate::operation::get_theme::GetThemeError::InternalServerException(inner) => Error::InternalServerException(inner),
429 crate::operation::get_theme::GetThemeError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
430 crate::operation::get_theme::GetThemeError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
431 crate::operation::get_theme::GetThemeError::Unhandled(inner) => Error::Unhandled(inner),
432 }
433 }
434}
435impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_codegen_jobs::ListCodegenJobsError, R>> for Error
436where
437 R: Send + Sync + std::fmt::Debug + 'static,
438{
439 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_codegen_jobs::ListCodegenJobsError, R>) -> Self {
440 match err {
441 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
442 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
443 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
444 source: err.into(),
445 }),
446 }
447 }
448}
449impl From<crate::operation::list_codegen_jobs::ListCodegenJobsError> for Error {
450 fn from(err: crate::operation::list_codegen_jobs::ListCodegenJobsError) -> Self {
451 match err {
452 crate::operation::list_codegen_jobs::ListCodegenJobsError::InternalServerException(inner) => Error::InternalServerException(inner),
453 crate::operation::list_codegen_jobs::ListCodegenJobsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
454 crate::operation::list_codegen_jobs::ListCodegenJobsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
455 crate::operation::list_codegen_jobs::ListCodegenJobsError::Unhandled(inner) => Error::Unhandled(inner),
456 }
457 }
458}
459impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_components::ListComponentsError, R>> for Error
460where
461 R: Send + Sync + std::fmt::Debug + 'static,
462{
463 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_components::ListComponentsError, R>) -> Self {
464 match err {
465 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
466 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
467 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
468 source: err.into(),
469 }),
470 }
471 }
472}
473impl From<crate::operation::list_components::ListComponentsError> for Error {
474 fn from(err: crate::operation::list_components::ListComponentsError) -> Self {
475 match err {
476 crate::operation::list_components::ListComponentsError::InternalServerException(inner) => Error::InternalServerException(inner),
477 crate::operation::list_components::ListComponentsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
478 crate::operation::list_components::ListComponentsError::Unhandled(inner) => Error::Unhandled(inner),
479 }
480 }
481}
482impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_forms::ListFormsError, R>> for Error
483where
484 R: Send + Sync + std::fmt::Debug + 'static,
485{
486 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_forms::ListFormsError, R>) -> Self {
487 match err {
488 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
489 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
490 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
491 source: err.into(),
492 }),
493 }
494 }
495}
496impl From<crate::operation::list_forms::ListFormsError> for Error {
497 fn from(err: crate::operation::list_forms::ListFormsError) -> Self {
498 match err {
499 crate::operation::list_forms::ListFormsError::InternalServerException(inner) => Error::InternalServerException(inner),
500 crate::operation::list_forms::ListFormsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
501 crate::operation::list_forms::ListFormsError::Unhandled(inner) => Error::Unhandled(inner),
502 }
503 }
504}
505impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
506where
507 R: Send + Sync + std::fmt::Debug + 'static,
508{
509 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
510 match err {
511 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
512 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
513 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
514 source: err.into(),
515 }),
516 }
517 }
518}
519impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
520 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
521 match err {
522 crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => {
523 Error::InternalServerException(inner)
524 }
525 crate::operation::list_tags_for_resource::ListTagsForResourceError::InvalidParameterException(inner) => {
526 Error::InvalidParameterException(inner)
527 }
528 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
529 Error::ResourceNotFoundException(inner)
530 }
531 crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
532 crate::operation::list_tags_for_resource::ListTagsForResourceError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
533 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
534 }
535 }
536}
537impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_themes::ListThemesError, R>> for Error
538where
539 R: Send + Sync + std::fmt::Debug + 'static,
540{
541 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_themes::ListThemesError, R>) -> Self {
542 match err {
543 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
544 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
545 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
546 source: err.into(),
547 }),
548 }
549 }
550}
551impl From<crate::operation::list_themes::ListThemesError> for Error {
552 fn from(err: crate::operation::list_themes::ListThemesError) -> Self {
553 match err {
554 crate::operation::list_themes::ListThemesError::InternalServerException(inner) => Error::InternalServerException(inner),
555 crate::operation::list_themes::ListThemesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
556 crate::operation::list_themes::ListThemesError::Unhandled(inner) => Error::Unhandled(inner),
557 }
558 }
559}
560impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_metadata_flag::PutMetadataFlagError, R>> for Error
561where
562 R: Send + Sync + std::fmt::Debug + 'static,
563{
564 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_metadata_flag::PutMetadataFlagError, R>) -> Self {
565 match err {
566 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
567 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
568 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
569 source: err.into(),
570 }),
571 }
572 }
573}
574impl From<crate::operation::put_metadata_flag::PutMetadataFlagError> for Error {
575 fn from(err: crate::operation::put_metadata_flag::PutMetadataFlagError) -> Self {
576 match err {
577 crate::operation::put_metadata_flag::PutMetadataFlagError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
578 crate::operation::put_metadata_flag::PutMetadataFlagError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
579 crate::operation::put_metadata_flag::PutMetadataFlagError::Unhandled(inner) => Error::Unhandled(inner),
580 }
581 }
582}
583impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::refresh_token::RefreshTokenError, R>> for Error
584where
585 R: Send + Sync + std::fmt::Debug + 'static,
586{
587 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::refresh_token::RefreshTokenError, R>) -> Self {
588 match err {
589 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
590 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
591 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
592 source: err.into(),
593 }),
594 }
595 }
596}
597impl From<crate::operation::refresh_token::RefreshTokenError> for Error {
598 fn from(err: crate::operation::refresh_token::RefreshTokenError) -> Self {
599 match err {
600 crate::operation::refresh_token::RefreshTokenError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
601 crate::operation::refresh_token::RefreshTokenError::Unhandled(inner) => Error::Unhandled(inner),
602 }
603 }
604}
605impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_codegen_job::StartCodegenJobError, R>> for Error
606where
607 R: Send + Sync + std::fmt::Debug + 'static,
608{
609 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_codegen_job::StartCodegenJobError, R>) -> Self {
610 match err {
611 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
612 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
613 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
614 source: err.into(),
615 }),
616 }
617 }
618}
619impl From<crate::operation::start_codegen_job::StartCodegenJobError> for Error {
620 fn from(err: crate::operation::start_codegen_job::StartCodegenJobError) -> Self {
621 match err {
622 crate::operation::start_codegen_job::StartCodegenJobError::InternalServerException(inner) => Error::InternalServerException(inner),
623 crate::operation::start_codegen_job::StartCodegenJobError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
624 crate::operation::start_codegen_job::StartCodegenJobError::ThrottlingException(inner) => Error::ThrottlingException(inner),
625 crate::operation::start_codegen_job::StartCodegenJobError::Unhandled(inner) => Error::Unhandled(inner),
626 }
627 }
628}
629impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
630where
631 R: Send + Sync + std::fmt::Debug + 'static,
632{
633 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
634 match err {
635 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
636 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
637 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
638 source: err.into(),
639 }),
640 }
641 }
642}
643impl From<crate::operation::tag_resource::TagResourceError> for Error {
644 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
645 match err {
646 crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
647 crate::operation::tag_resource::TagResourceError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
648 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
649 crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
650 crate::operation::tag_resource::TagResourceError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
651 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
652 }
653 }
654}
655impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
656where
657 R: Send + Sync + std::fmt::Debug + 'static,
658{
659 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
660 match err {
661 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
662 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
663 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
664 source: err.into(),
665 }),
666 }
667 }
668}
669impl From<crate::operation::untag_resource::UntagResourceError> for Error {
670 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
671 match err {
672 crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
673 crate::operation::untag_resource::UntagResourceError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
674 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
675 crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
676 crate::operation::untag_resource::UntagResourceError::UnauthorizedException(inner) => Error::UnauthorizedException(inner),
677 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
678 }
679 }
680}
681impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_component::UpdateComponentError, R>> for Error
682where
683 R: Send + Sync + std::fmt::Debug + 'static,
684{
685 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_component::UpdateComponentError, R>) -> Self {
686 match err {
687 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
688 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
689 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
690 source: err.into(),
691 }),
692 }
693 }
694}
695impl From<crate::operation::update_component::UpdateComponentError> for Error {
696 fn from(err: crate::operation::update_component::UpdateComponentError) -> Self {
697 match err {
698 crate::operation::update_component::UpdateComponentError::InternalServerException(inner) => Error::InternalServerException(inner),
699 crate::operation::update_component::UpdateComponentError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
700 crate::operation::update_component::UpdateComponentError::ResourceConflictException(inner) => Error::ResourceConflictException(inner),
701 crate::operation::update_component::UpdateComponentError::Unhandled(inner) => Error::Unhandled(inner),
702 }
703 }
704}
705impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_form::UpdateFormError, R>> for Error
706where
707 R: Send + Sync + std::fmt::Debug + 'static,
708{
709 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_form::UpdateFormError, R>) -> Self {
710 match err {
711 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
712 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
713 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
714 source: err.into(),
715 }),
716 }
717 }
718}
719impl From<crate::operation::update_form::UpdateFormError> for Error {
720 fn from(err: crate::operation::update_form::UpdateFormError) -> Self {
721 match err {
722 crate::operation::update_form::UpdateFormError::InternalServerException(inner) => Error::InternalServerException(inner),
723 crate::operation::update_form::UpdateFormError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
724 crate::operation::update_form::UpdateFormError::ResourceConflictException(inner) => Error::ResourceConflictException(inner),
725 crate::operation::update_form::UpdateFormError::Unhandled(inner) => Error::Unhandled(inner),
726 }
727 }
728}
729impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_theme::UpdateThemeError, R>> for Error
730where
731 R: Send + Sync + std::fmt::Debug + 'static,
732{
733 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_theme::UpdateThemeError, R>) -> Self {
734 match err {
735 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
736 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
737 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
738 source: err.into(),
739 }),
740 }
741 }
742}
743impl From<crate::operation::update_theme::UpdateThemeError> for Error {
744 fn from(err: crate::operation::update_theme::UpdateThemeError) -> Self {
745 match err {
746 crate::operation::update_theme::UpdateThemeError::InternalServerException(inner) => Error::InternalServerException(inner),
747 crate::operation::update_theme::UpdateThemeError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
748 crate::operation::update_theme::UpdateThemeError::ResourceConflictException(inner) => Error::ResourceConflictException(inner),
749 crate::operation::update_theme::UpdateThemeError::Unhandled(inner) => Error::Unhandled(inner),
750 }
751 }
752}
753impl ::std::error::Error for Error {
754 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
755 match self {
756 Error::InternalServerException(inner) => inner.source(),
757 Error::InvalidParameterException(inner) => inner.source(),
758 Error::ResourceConflictException(inner) => inner.source(),
759 Error::ResourceNotFoundException(inner) => inner.source(),
760 Error::ServiceQuotaExceededException(inner) => inner.source(),
761 Error::ThrottlingException(inner) => inner.source(),
762 Error::UnauthorizedException(inner) => inner.source(),
763 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
764 }
765 }
766}
767impl ::aws_types::request_id::RequestId for Error {
768 fn request_id(&self) -> Option<&str> {
769 match self {
770 Self::InternalServerException(e) => e.request_id(),
771 Self::InvalidParameterException(e) => e.request_id(),
772 Self::ResourceConflictException(e) => e.request_id(),
773 Self::ResourceNotFoundException(e) => e.request_id(),
774 Self::ServiceQuotaExceededException(e) => e.request_id(),
775 Self::ThrottlingException(e) => e.request_id(),
776 Self::UnauthorizedException(e) => e.request_id(),
777 Self::Unhandled(e) => e.meta.request_id(),
778 }
779 }
780}