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