1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 AccessDeniedException(crate::types::error::AccessDeniedException),
8 ConflictException(crate::types::error::ConflictException),
10 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
12 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
14 ThrottlingException(crate::types::error::ThrottlingException),
16 ValidationException(crate::types::error::ValidationException),
18 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
20 variable wildcard pattern and check `.code()`:
21 \
22 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
23 \
24 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
25 Unhandled(crate::error::sealed_unhandled::Unhandled),
26}
27impl ::std::fmt::Display for Error {
28 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29 match self {
30 Error::AccessDeniedException(inner) => inner.fmt(f),
31 Error::ConflictException(inner) => inner.fmt(f),
32 Error::ResourceNotFoundException(inner) => inner.fmt(f),
33 Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
34 Error::ThrottlingException(inner) => inner.fmt(f),
35 Error::ValidationException(inner) => inner.fmt(f),
36 Error::Unhandled(_) => {
37 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
38 write!(f, "unhandled error ({code})")
39 } else {
40 f.write_str("unhandled error")
41 }
42 }
43 }
44 }
45}
46impl From<::aws_smithy_types::error::operation::BuildError> for Error {
47 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
48 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
49 source: value.into(),
50 meta: ::std::default::Default::default(),
51 })
52 }
53}
54impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
55 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
56 match self {
57 Self::AccessDeniedException(inner) => inner.meta(),
58 Self::ConflictException(inner) => inner.meta(),
59 Self::ResourceNotFoundException(inner) => inner.meta(),
60 Self::ServiceQuotaExceededException(inner) => inner.meta(),
61 Self::ThrottlingException(inner) => inner.meta(),
62 Self::ValidationException(inner) => inner.meta(),
63 Self::Unhandled(inner) => &inner.meta,
64 }
65 }
66}
67impl<R>
68 From<
69 ::aws_smithy_runtime_api::client::result::SdkError<
70 crate::operation::batch_get_service_level_objective_budget_report::BatchGetServiceLevelObjectiveBudgetReportError,
71 R,
72 >,
73 > for Error
74where
75 R: Send + Sync + std::fmt::Debug + 'static,
76{
77 fn from(
78 err: ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::batch_get_service_level_objective_budget_report::BatchGetServiceLevelObjectiveBudgetReportError,
80 R,
81 >,
82 ) -> Self {
83 match err {
84 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
85 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
86 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
87 source: err.into(),
88 }),
89 }
90 }
91}
92impl From<crate::operation::batch_get_service_level_objective_budget_report::BatchGetServiceLevelObjectiveBudgetReportError> for Error {
93 fn from(err: crate::operation::batch_get_service_level_objective_budget_report::BatchGetServiceLevelObjectiveBudgetReportError) -> Self {
94 match err {
95 crate::operation::batch_get_service_level_objective_budget_report::BatchGetServiceLevelObjectiveBudgetReportError::ThrottlingException(inner) => Error::ThrottlingException(inner),
96 crate::operation::batch_get_service_level_objective_budget_report::BatchGetServiceLevelObjectiveBudgetReportError::ValidationException(inner) => Error::ValidationException(inner),
97 crate::operation::batch_get_service_level_objective_budget_report::BatchGetServiceLevelObjectiveBudgetReportError::Unhandled(inner) => Error::Unhandled(inner),
98 }
99 }
100}
101impl<R>
102 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError, R>>
103 for Error
104where
105 R: Send + Sync + std::fmt::Debug + 'static,
106{
107 fn from(
108 err: ::aws_smithy_runtime_api::client::result::SdkError<
109 crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError,
110 R,
111 >,
112 ) -> Self {
113 match err {
114 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
115 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
116 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
117 source: err.into(),
118 }),
119 }
120 }
121}
122impl From<crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError> for Error {
123 fn from(err: crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError) -> Self {
124 match err {
125 crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError::ResourceNotFoundException(inner) => {
126 Error::ResourceNotFoundException(inner)
127 }
128 crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError::ThrottlingException(inner) => {
129 Error::ThrottlingException(inner)
130 }
131 crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError::ValidationException(inner) => {
132 Error::ValidationException(inner)
133 }
134 crate::operation::batch_update_exclusion_windows::BatchUpdateExclusionWindowsError::Unhandled(inner) => Error::Unhandled(inner),
135 }
136 }
137}
138impl<R>
139 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError, R>>
140 for Error
141where
142 R: Send + Sync + std::fmt::Debug + 'static,
143{
144 fn from(
145 err: ::aws_smithy_runtime_api::client::result::SdkError<
146 crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError,
147 R,
148 >,
149 ) -> Self {
150 match err {
151 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
152 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
153 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
154 source: err.into(),
155 }),
156 }
157 }
158}
159impl From<crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError> for Error {
160 fn from(err: crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError) -> Self {
161 match err {
162 crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError::AccessDeniedException(inner) => {
163 Error::AccessDeniedException(inner)
164 }
165 crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError::ConflictException(inner) => {
166 Error::ConflictException(inner)
167 }
168 crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError::ServiceQuotaExceededException(inner) => {
169 Error::ServiceQuotaExceededException(inner)
170 }
171 crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError::ThrottlingException(inner) => {
172 Error::ThrottlingException(inner)
173 }
174 crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError::ValidationException(inner) => {
175 Error::ValidationException(inner)
176 }
177 crate::operation::create_service_level_objective::CreateServiceLevelObjectiveError::Unhandled(inner) => Error::Unhandled(inner),
178 }
179 }
180}
181impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError, R>>
182 for Error
183where
184 R: Send + Sync + std::fmt::Debug + 'static,
185{
186 fn from(
187 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError, R>,
188 ) -> Self {
189 match err {
190 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
191 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
192 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
193 source: err.into(),
194 }),
195 }
196 }
197}
198impl From<crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError> for Error {
199 fn from(err: crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError) -> Self {
200 match err {
201 crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError::AccessDeniedException(inner) => {
202 Error::AccessDeniedException(inner)
203 }
204 crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError::ThrottlingException(inner) => {
205 Error::ThrottlingException(inner)
206 }
207 crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError::ValidationException(inner) => {
208 Error::ValidationException(inner)
209 }
210 crate::operation::delete_grouping_configuration::DeleteGroupingConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
211 }
212 }
213}
214impl<R>
215 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError, R>>
216 for Error
217where
218 R: Send + Sync + std::fmt::Debug + 'static,
219{
220 fn from(
221 err: ::aws_smithy_runtime_api::client::result::SdkError<
222 crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError,
223 R,
224 >,
225 ) -> Self {
226 match err {
227 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
228 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
229 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
230 source: err.into(),
231 }),
232 }
233 }
234}
235impl From<crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError> for Error {
236 fn from(err: crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError) -> Self {
237 match err {
238 crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError::ResourceNotFoundException(inner) => {
239 Error::ResourceNotFoundException(inner)
240 }
241 crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError::ThrottlingException(inner) => {
242 Error::ThrottlingException(inner)
243 }
244 crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError::ValidationException(inner) => {
245 Error::ValidationException(inner)
246 }
247 crate::operation::delete_service_level_objective::DeleteServiceLevelObjectiveError::Unhandled(inner) => Error::Unhandled(inner),
248 }
249 }
250}
251impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_service::GetServiceError, R>> for Error
252where
253 R: Send + Sync + std::fmt::Debug + 'static,
254{
255 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_service::GetServiceError, R>) -> Self {
256 match err {
257 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
258 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
259 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
260 source: err.into(),
261 }),
262 }
263 }
264}
265impl From<crate::operation::get_service::GetServiceError> for Error {
266 fn from(err: crate::operation::get_service::GetServiceError) -> Self {
267 match err {
268 crate::operation::get_service::GetServiceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
269 crate::operation::get_service::GetServiceError::ValidationException(inner) => Error::ValidationException(inner),
270 crate::operation::get_service::GetServiceError::Unhandled(inner) => Error::Unhandled(inner),
271 }
272 }
273}
274impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_service_level_objective::GetServiceLevelObjectiveError, R>>
275 for Error
276where
277 R: Send + Sync + std::fmt::Debug + 'static,
278{
279 fn from(
280 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_service_level_objective::GetServiceLevelObjectiveError, R>,
281 ) -> 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::get_service_level_objective::GetServiceLevelObjectiveError> for Error {
292 fn from(err: crate::operation::get_service_level_objective::GetServiceLevelObjectiveError) -> Self {
293 match err {
294 crate::operation::get_service_level_objective::GetServiceLevelObjectiveError::ResourceNotFoundException(inner) => {
295 Error::ResourceNotFoundException(inner)
296 }
297 crate::operation::get_service_level_objective::GetServiceLevelObjectiveError::ThrottlingException(inner) => {
298 Error::ThrottlingException(inner)
299 }
300 crate::operation::get_service_level_objective::GetServiceLevelObjectiveError::ValidationException(inner) => {
301 Error::ValidationException(inner)
302 }
303 crate::operation::get_service_level_objective::GetServiceLevelObjectiveError::Unhandled(inner) => Error::Unhandled(inner),
304 }
305 }
306}
307impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_audit_findings::ListAuditFindingsError, R>> for Error
308where
309 R: Send + Sync + std::fmt::Debug + 'static,
310{
311 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_audit_findings::ListAuditFindingsError, R>) -> Self {
312 match err {
313 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
314 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
315 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
316 source: err.into(),
317 }),
318 }
319 }
320}
321impl From<crate::operation::list_audit_findings::ListAuditFindingsError> for Error {
322 fn from(err: crate::operation::list_audit_findings::ListAuditFindingsError) -> Self {
323 match err {
324 crate::operation::list_audit_findings::ListAuditFindingsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
325 crate::operation::list_audit_findings::ListAuditFindingsError::ValidationException(inner) => Error::ValidationException(inner),
326 crate::operation::list_audit_findings::ListAuditFindingsError::Unhandled(inner) => Error::Unhandled(inner),
327 }
328 }
329}
330impl<R>
331 From<
332 ::aws_smithy_runtime_api::client::result::SdkError<
333 crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError,
334 R,
335 >,
336 > for Error
337where
338 R: Send + Sync + std::fmt::Debug + 'static,
339{
340 fn from(
341 err: ::aws_smithy_runtime_api::client::result::SdkError<
342 crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError,
343 R,
344 >,
345 ) -> Self {
346 match err {
347 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
348 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
349 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
350 source: err.into(),
351 }),
352 }
353 }
354}
355impl From<crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError> for Error {
356 fn from(err: crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError) -> Self {
357 match err {
358 crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError::AccessDeniedException(inner) => {
359 Error::AccessDeniedException(inner)
360 }
361 crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError::ThrottlingException(inner) => {
362 Error::ThrottlingException(inner)
363 }
364 crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError::ValidationException(inner) => {
365 Error::ValidationException(inner)
366 }
367 crate::operation::list_grouping_attribute_definitions::ListGroupingAttributeDefinitionsError::Unhandled(inner) => Error::Unhandled(inner),
368 }
369 }
370}
371impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_dependencies::ListServiceDependenciesError, R>>
372 for Error
373where
374 R: Send + Sync + std::fmt::Debug + 'static,
375{
376 fn from(
377 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_dependencies::ListServiceDependenciesError, R>,
378 ) -> Self {
379 match err {
380 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
381 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
382 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
383 source: err.into(),
384 }),
385 }
386 }
387}
388impl From<crate::operation::list_service_dependencies::ListServiceDependenciesError> for Error {
389 fn from(err: crate::operation::list_service_dependencies::ListServiceDependenciesError) -> Self {
390 match err {
391 crate::operation::list_service_dependencies::ListServiceDependenciesError::ThrottlingException(inner) => {
392 Error::ThrottlingException(inner)
393 }
394 crate::operation::list_service_dependencies::ListServiceDependenciesError::ValidationException(inner) => {
395 Error::ValidationException(inner)
396 }
397 crate::operation::list_service_dependencies::ListServiceDependenciesError::Unhandled(inner) => Error::Unhandled(inner),
398 }
399 }
400}
401impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_dependents::ListServiceDependentsError, R>> for Error
402where
403 R: Send + Sync + std::fmt::Debug + 'static,
404{
405 fn from(
406 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_dependents::ListServiceDependentsError, R>,
407 ) -> Self {
408 match err {
409 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
410 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
411 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
412 source: err.into(),
413 }),
414 }
415 }
416}
417impl From<crate::operation::list_service_dependents::ListServiceDependentsError> for Error {
418 fn from(err: crate::operation::list_service_dependents::ListServiceDependentsError) -> Self {
419 match err {
420 crate::operation::list_service_dependents::ListServiceDependentsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
421 crate::operation::list_service_dependents::ListServiceDependentsError::ValidationException(inner) => Error::ValidationException(inner),
422 crate::operation::list_service_dependents::ListServiceDependentsError::Unhandled(inner) => Error::Unhandled(inner),
423 }
424 }
425}
426impl<R>
427 From<
428 ::aws_smithy_runtime_api::client::result::SdkError<
429 crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError,
430 R,
431 >,
432 > for Error
433where
434 R: Send + Sync + std::fmt::Debug + 'static,
435{
436 fn from(
437 err: ::aws_smithy_runtime_api::client::result::SdkError<
438 crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError,
439 R,
440 >,
441 ) -> Self {
442 match err {
443 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
444 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
445 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
446 source: err.into(),
447 }),
448 }
449 }
450}
451impl From<crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError> for Error {
452 fn from(err: crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError) -> Self {
453 match err {
454 crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
455 crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
456 crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError::ValidationException(inner) => Error::ValidationException(inner),
457 crate::operation::list_service_level_objective_exclusion_windows::ListServiceLevelObjectiveExclusionWindowsError::Unhandled(inner) => Error::Unhandled(inner),
458 }
459 }
460}
461impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError, R>>
462 for Error
463where
464 R: Send + Sync + std::fmt::Debug + 'static,
465{
466 fn from(
467 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError, R>,
468 ) -> Self {
469 match err {
470 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
471 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
472 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
473 source: err.into(),
474 }),
475 }
476 }
477}
478impl From<crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError> for Error {
479 fn from(err: crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError) -> Self {
480 match err {
481 crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError::ThrottlingException(inner) => {
482 Error::ThrottlingException(inner)
483 }
484 crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError::ValidationException(inner) => {
485 Error::ValidationException(inner)
486 }
487 crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError::Unhandled(inner) => Error::Unhandled(inner),
488 }
489 }
490}
491impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_operations::ListServiceOperationsError, R>> for Error
492where
493 R: Send + Sync + std::fmt::Debug + 'static,
494{
495 fn from(
496 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_operations::ListServiceOperationsError, R>,
497 ) -> Self {
498 match err {
499 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
500 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
501 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
502 source: err.into(),
503 }),
504 }
505 }
506}
507impl From<crate::operation::list_service_operations::ListServiceOperationsError> for Error {
508 fn from(err: crate::operation::list_service_operations::ListServiceOperationsError) -> Self {
509 match err {
510 crate::operation::list_service_operations::ListServiceOperationsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
511 crate::operation::list_service_operations::ListServiceOperationsError::ValidationException(inner) => Error::ValidationException(inner),
512 crate::operation::list_service_operations::ListServiceOperationsError::Unhandled(inner) => Error::Unhandled(inner),
513 }
514 }
515}
516impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_services::ListServicesError, R>> for Error
517where
518 R: Send + Sync + std::fmt::Debug + 'static,
519{
520 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_services::ListServicesError, R>) -> Self {
521 match err {
522 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
523 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
524 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
525 source: err.into(),
526 }),
527 }
528 }
529}
530impl From<crate::operation::list_services::ListServicesError> for Error {
531 fn from(err: crate::operation::list_services::ListServicesError) -> Self {
532 match err {
533 crate::operation::list_services::ListServicesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
534 crate::operation::list_services::ListServicesError::ValidationException(inner) => Error::ValidationException(inner),
535 crate::operation::list_services::ListServicesError::Unhandled(inner) => Error::Unhandled(inner),
536 }
537 }
538}
539impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_states::ListServiceStatesError, R>> for Error
540where
541 R: Send + Sync + std::fmt::Debug + 'static,
542{
543 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_service_states::ListServiceStatesError, R>) -> Self {
544 match err {
545 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
546 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
547 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
548 source: err.into(),
549 }),
550 }
551 }
552}
553impl From<crate::operation::list_service_states::ListServiceStatesError> for Error {
554 fn from(err: crate::operation::list_service_states::ListServiceStatesError) -> Self {
555 match err {
556 crate::operation::list_service_states::ListServiceStatesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
557 crate::operation::list_service_states::ListServiceStatesError::ValidationException(inner) => Error::ValidationException(inner),
558 crate::operation::list_service_states::ListServiceStatesError::Unhandled(inner) => Error::Unhandled(inner),
559 }
560 }
561}
562impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
563where
564 R: Send + Sync + std::fmt::Debug + 'static,
565{
566 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
567 match err {
568 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
569 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
570 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
571 source: err.into(),
572 }),
573 }
574 }
575}
576impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
577 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
578 match err {
579 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
580 Error::ResourceNotFoundException(inner)
581 }
582 crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
583 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
584 }
585 }
586}
587impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_grouping_configuration::PutGroupingConfigurationError, R>>
588 for Error
589where
590 R: Send + Sync + std::fmt::Debug + 'static,
591{
592 fn from(
593 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_grouping_configuration::PutGroupingConfigurationError, R>,
594 ) -> Self {
595 match err {
596 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
597 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
598 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
599 source: err.into(),
600 }),
601 }
602 }
603}
604impl From<crate::operation::put_grouping_configuration::PutGroupingConfigurationError> for Error {
605 fn from(err: crate::operation::put_grouping_configuration::PutGroupingConfigurationError) -> Self {
606 match err {
607 crate::operation::put_grouping_configuration::PutGroupingConfigurationError::AccessDeniedException(inner) => {
608 Error::AccessDeniedException(inner)
609 }
610 crate::operation::put_grouping_configuration::PutGroupingConfigurationError::ThrottlingException(inner) => {
611 Error::ThrottlingException(inner)
612 }
613 crate::operation::put_grouping_configuration::PutGroupingConfigurationError::ValidationException(inner) => {
614 Error::ValidationException(inner)
615 }
616 crate::operation::put_grouping_configuration::PutGroupingConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
617 }
618 }
619}
620impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_discovery::StartDiscoveryError, R>> for Error
621where
622 R: Send + Sync + std::fmt::Debug + 'static,
623{
624 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_discovery::StartDiscoveryError, R>) -> Self {
625 match err {
626 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
627 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
628 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
629 source: err.into(),
630 }),
631 }
632 }
633}
634impl From<crate::operation::start_discovery::StartDiscoveryError> for Error {
635 fn from(err: crate::operation::start_discovery::StartDiscoveryError) -> Self {
636 match err {
637 crate::operation::start_discovery::StartDiscoveryError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
638 crate::operation::start_discovery::StartDiscoveryError::ThrottlingException(inner) => Error::ThrottlingException(inner),
639 crate::operation::start_discovery::StartDiscoveryError::ValidationException(inner) => Error::ValidationException(inner),
640 crate::operation::start_discovery::StartDiscoveryError::Unhandled(inner) => Error::Unhandled(inner),
641 }
642 }
643}
644impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
645where
646 R: Send + Sync + std::fmt::Debug + 'static,
647{
648 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
649 match err {
650 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
651 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
652 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
653 source: err.into(),
654 }),
655 }
656 }
657}
658impl From<crate::operation::tag_resource::TagResourceError> for Error {
659 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
660 match err {
661 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
662 crate::operation::tag_resource::TagResourceError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
663 crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
664 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
665 }
666 }
667}
668impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
669where
670 R: Send + Sync + std::fmt::Debug + 'static,
671{
672 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
673 match err {
674 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
675 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
676 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
677 source: err.into(),
678 }),
679 }
680 }
681}
682impl From<crate::operation::untag_resource::UntagResourceError> for Error {
683 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
684 match err {
685 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
686 crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
687 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
688 }
689 }
690}
691impl<R>
692 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError, R>>
693 for Error
694where
695 R: Send + Sync + std::fmt::Debug + 'static,
696{
697 fn from(
698 err: ::aws_smithy_runtime_api::client::result::SdkError<
699 crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError,
700 R,
701 >,
702 ) -> Self {
703 match err {
704 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
705 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
706 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
707 source: err.into(),
708 }),
709 }
710 }
711}
712impl From<crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError> for Error {
713 fn from(err: crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError) -> Self {
714 match err {
715 crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError::ResourceNotFoundException(inner) => {
716 Error::ResourceNotFoundException(inner)
717 }
718 crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError::ThrottlingException(inner) => {
719 Error::ThrottlingException(inner)
720 }
721 crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError::ValidationException(inner) => {
722 Error::ValidationException(inner)
723 }
724 crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError::Unhandled(inner) => Error::Unhandled(inner),
725 }
726 }
727}
728impl ::std::error::Error for Error {
729 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
730 match self {
731 Error::AccessDeniedException(inner) => inner.source(),
732 Error::ConflictException(inner) => inner.source(),
733 Error::ResourceNotFoundException(inner) => inner.source(),
734 Error::ServiceQuotaExceededException(inner) => inner.source(),
735 Error::ThrottlingException(inner) => inner.source(),
736 Error::ValidationException(inner) => inner.source(),
737 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
738 }
739 }
740}
741impl ::aws_types::request_id::RequestId for Error {
742 fn request_id(&self) -> Option<&str> {
743 match self {
744 Self::AccessDeniedException(e) => e.request_id(),
745 Self::ConflictException(e) => e.request_id(),
746 Self::ResourceNotFoundException(e) => e.request_id(),
747 Self::ServiceQuotaExceededException(e) => e.request_id(),
748 Self::ThrottlingException(e) => e.request_id(),
749 Self::ValidationException(e) => e.request_id(),
750 Self::Unhandled(e) => e.meta.request_id(),
751 }
752 }
753}