1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 AccessDeniedException(crate::types::error::AccessDeniedException),
8 ConflictException(crate::types::error::ConflictException),
10 InternalServerException(crate::types::error::InternalServerException),
12 NotFoundException(crate::types::error::NotFoundException),
14 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
16 ThrottlingException(crate::types::error::ThrottlingException),
18 ValidationException(crate::types::error::ValidationException),
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::AccessDeniedException(inner) => inner.fmt(f),
33 Error::ConflictException(inner) => inner.fmt(f),
34 Error::InternalServerException(inner) => inner.fmt(f),
35 Error::NotFoundException(inner) => inner.fmt(f),
36 Error::ResourceNotFoundException(inner) => inner.fmt(f),
37 Error::ThrottlingException(inner) => inner.fmt(f),
38 Error::ValidationException(inner) => inner.fmt(f),
39 Error::Unhandled(_) => {
40 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
41 write!(f, "unhandled error ({code})")
42 } else {
43 f.write_str("unhandled error")
44 }
45 }
46 }
47 }
48}
49impl From<::aws_smithy_types::error::operation::BuildError> for Error {
50 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
51 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
52 source: value.into(),
53 meta: ::std::default::Default::default(),
54 })
55 }
56}
57impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
58 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
59 match self {
60 Self::AccessDeniedException(inner) => inner.meta(),
61 Self::ConflictException(inner) => inner.meta(),
62 Self::InternalServerException(inner) => inner.meta(),
63 Self::NotFoundException(inner) => inner.meta(),
64 Self::ResourceNotFoundException(inner) => inner.meta(),
65 Self::ThrottlingException(inner) => inner.meta(),
66 Self::ValidationException(inner) => inner.meta(),
67 Self::Unhandled(inner) => &inner.meta,
68 }
69 }
70}
71impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_repository::AssociateRepositoryError, R>> for Error
72where
73 R: Send + Sync + std::fmt::Debug + 'static,
74{
75 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::associate_repository::AssociateRepositoryError, R>) -> Self {
76 match err {
77 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
78 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
79 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
80 source: err.into(),
81 }),
82 }
83 }
84}
85impl From<crate::operation::associate_repository::AssociateRepositoryError> for Error {
86 fn from(err: crate::operation::associate_repository::AssociateRepositoryError) -> Self {
87 match err {
88 crate::operation::associate_repository::AssociateRepositoryError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
89 crate::operation::associate_repository::AssociateRepositoryError::ConflictException(inner) => Error::ConflictException(inner),
90 crate::operation::associate_repository::AssociateRepositoryError::InternalServerException(inner) => Error::InternalServerException(inner),
91 crate::operation::associate_repository::AssociateRepositoryError::ThrottlingException(inner) => Error::ThrottlingException(inner),
92 crate::operation::associate_repository::AssociateRepositoryError::ValidationException(inner) => Error::ValidationException(inner),
93 crate::operation::associate_repository::AssociateRepositoryError::Unhandled(inner) => Error::Unhandled(inner),
94 }
95 }
96}
97impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_code_review::CreateCodeReviewError, R>> for Error
98where
99 R: Send + Sync + std::fmt::Debug + 'static,
100{
101 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_code_review::CreateCodeReviewError, R>) -> Self {
102 match err {
103 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
104 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
105 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
106 source: err.into(),
107 }),
108 }
109 }
110}
111impl From<crate::operation::create_code_review::CreateCodeReviewError> for Error {
112 fn from(err: crate::operation::create_code_review::CreateCodeReviewError) -> Self {
113 match err {
114 crate::operation::create_code_review::CreateCodeReviewError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
115 crate::operation::create_code_review::CreateCodeReviewError::ConflictException(inner) => Error::ConflictException(inner),
116 crate::operation::create_code_review::CreateCodeReviewError::InternalServerException(inner) => Error::InternalServerException(inner),
117 crate::operation::create_code_review::CreateCodeReviewError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
118 crate::operation::create_code_review::CreateCodeReviewError::ThrottlingException(inner) => Error::ThrottlingException(inner),
119 crate::operation::create_code_review::CreateCodeReviewError::ValidationException(inner) => Error::ValidationException(inner),
120 crate::operation::create_code_review::CreateCodeReviewError::Unhandled(inner) => Error::Unhandled(inner),
121 }
122 }
123}
124impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_code_review::DescribeCodeReviewError, R>> for Error
125where
126 R: Send + Sync + std::fmt::Debug + 'static,
127{
128 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_code_review::DescribeCodeReviewError, R>) -> Self {
129 match err {
130 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
131 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
132 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
133 source: err.into(),
134 }),
135 }
136 }
137}
138impl From<crate::operation::describe_code_review::DescribeCodeReviewError> for Error {
139 fn from(err: crate::operation::describe_code_review::DescribeCodeReviewError) -> Self {
140 match err {
141 crate::operation::describe_code_review::DescribeCodeReviewError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
142 crate::operation::describe_code_review::DescribeCodeReviewError::InternalServerException(inner) => Error::InternalServerException(inner),
143 crate::operation::describe_code_review::DescribeCodeReviewError::ResourceNotFoundException(inner) => {
144 Error::ResourceNotFoundException(inner)
145 }
146 crate::operation::describe_code_review::DescribeCodeReviewError::ThrottlingException(inner) => Error::ThrottlingException(inner),
147 crate::operation::describe_code_review::DescribeCodeReviewError::ValidationException(inner) => Error::ValidationException(inner),
148 crate::operation::describe_code_review::DescribeCodeReviewError::Unhandled(inner) => Error::Unhandled(inner),
149 }
150 }
151}
152impl<R>
153 From<
154 ::aws_smithy_runtime_api::client::result::SdkError<
155 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError,
156 R,
157 >,
158 > for Error
159where
160 R: Send + Sync + std::fmt::Debug + 'static,
161{
162 fn from(
163 err: ::aws_smithy_runtime_api::client::result::SdkError<
164 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError,
165 R,
166 >,
167 ) -> 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::describe_recommendation_feedback::DescribeRecommendationFeedbackError> for Error {
178 fn from(err: crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError) -> Self {
179 match err {
180 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError::AccessDeniedException(inner) => {
181 Error::AccessDeniedException(inner)
182 }
183 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError::InternalServerException(inner) => {
184 Error::InternalServerException(inner)
185 }
186 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError::ResourceNotFoundException(inner) => {
187 Error::ResourceNotFoundException(inner)
188 }
189 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError::ThrottlingException(inner) => {
190 Error::ThrottlingException(inner)
191 }
192 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError::ValidationException(inner) => {
193 Error::ValidationException(inner)
194 }
195 crate::operation::describe_recommendation_feedback::DescribeRecommendationFeedbackError::Unhandled(inner) => Error::Unhandled(inner),
196 }
197 }
198}
199impl<R>
200 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_repository_association::DescribeRepositoryAssociationError, R>>
201 for Error
202where
203 R: Send + Sync + std::fmt::Debug + 'static,
204{
205 fn from(
206 err: ::aws_smithy_runtime_api::client::result::SdkError<
207 crate::operation::describe_repository_association::DescribeRepositoryAssociationError,
208 R,
209 >,
210 ) -> Self {
211 match err {
212 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
213 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
214 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
215 source: err.into(),
216 }),
217 }
218 }
219}
220impl From<crate::operation::describe_repository_association::DescribeRepositoryAssociationError> for Error {
221 fn from(err: crate::operation::describe_repository_association::DescribeRepositoryAssociationError) -> Self {
222 match err {
223 crate::operation::describe_repository_association::DescribeRepositoryAssociationError::AccessDeniedException(inner) => {
224 Error::AccessDeniedException(inner)
225 }
226 crate::operation::describe_repository_association::DescribeRepositoryAssociationError::InternalServerException(inner) => {
227 Error::InternalServerException(inner)
228 }
229 crate::operation::describe_repository_association::DescribeRepositoryAssociationError::NotFoundException(inner) => {
230 Error::NotFoundException(inner)
231 }
232 crate::operation::describe_repository_association::DescribeRepositoryAssociationError::ThrottlingException(inner) => {
233 Error::ThrottlingException(inner)
234 }
235 crate::operation::describe_repository_association::DescribeRepositoryAssociationError::ValidationException(inner) => {
236 Error::ValidationException(inner)
237 }
238 crate::operation::describe_repository_association::DescribeRepositoryAssociationError::Unhandled(inner) => Error::Unhandled(inner),
239 }
240 }
241}
242impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_repository::DisassociateRepositoryError, R>> for Error
243where
244 R: Send + Sync + std::fmt::Debug + 'static,
245{
246 fn from(
247 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::disassociate_repository::DisassociateRepositoryError, R>,
248 ) -> Self {
249 match err {
250 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
251 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
252 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
253 source: err.into(),
254 }),
255 }
256 }
257}
258impl From<crate::operation::disassociate_repository::DisassociateRepositoryError> for Error {
259 fn from(err: crate::operation::disassociate_repository::DisassociateRepositoryError) -> Self {
260 match err {
261 crate::operation::disassociate_repository::DisassociateRepositoryError::AccessDeniedException(inner) => {
262 Error::AccessDeniedException(inner)
263 }
264 crate::operation::disassociate_repository::DisassociateRepositoryError::ConflictException(inner) => Error::ConflictException(inner),
265 crate::operation::disassociate_repository::DisassociateRepositoryError::InternalServerException(inner) => {
266 Error::InternalServerException(inner)
267 }
268 crate::operation::disassociate_repository::DisassociateRepositoryError::NotFoundException(inner) => Error::NotFoundException(inner),
269 crate::operation::disassociate_repository::DisassociateRepositoryError::ThrottlingException(inner) => Error::ThrottlingException(inner),
270 crate::operation::disassociate_repository::DisassociateRepositoryError::ValidationException(inner) => Error::ValidationException(inner),
271 crate::operation::disassociate_repository::DisassociateRepositoryError::Unhandled(inner) => Error::Unhandled(inner),
272 }
273 }
274}
275impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_code_reviews::ListCodeReviewsError, R>> for Error
276where
277 R: Send + Sync + std::fmt::Debug + 'static,
278{
279 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_code_reviews::ListCodeReviewsError, R>) -> Self {
280 match err {
281 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
282 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
283 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
284 source: err.into(),
285 }),
286 }
287 }
288}
289impl From<crate::operation::list_code_reviews::ListCodeReviewsError> for Error {
290 fn from(err: crate::operation::list_code_reviews::ListCodeReviewsError) -> Self {
291 match err {
292 crate::operation::list_code_reviews::ListCodeReviewsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
293 crate::operation::list_code_reviews::ListCodeReviewsError::InternalServerException(inner) => Error::InternalServerException(inner),
294 crate::operation::list_code_reviews::ListCodeReviewsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
295 crate::operation::list_code_reviews::ListCodeReviewsError::ValidationException(inner) => Error::ValidationException(inner),
296 crate::operation::list_code_reviews::ListCodeReviewsError::Unhandled(inner) => Error::Unhandled(inner),
297 }
298 }
299}
300impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError, R>>
301 for Error
302where
303 R: Send + Sync + std::fmt::Debug + 'static,
304{
305 fn from(
306 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError, R>,
307 ) -> Self {
308 match err {
309 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
310 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
311 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
312 source: err.into(),
313 }),
314 }
315 }
316}
317impl From<crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError> for Error {
318 fn from(err: crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError) -> Self {
319 match err {
320 crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError::AccessDeniedException(inner) => {
321 Error::AccessDeniedException(inner)
322 }
323 crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError::InternalServerException(inner) => {
324 Error::InternalServerException(inner)
325 }
326 crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError::ResourceNotFoundException(inner) => {
327 Error::ResourceNotFoundException(inner)
328 }
329 crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError::ThrottlingException(inner) => {
330 Error::ThrottlingException(inner)
331 }
332 crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError::ValidationException(inner) => {
333 Error::ValidationException(inner)
334 }
335 crate::operation::list_recommendation_feedback::ListRecommendationFeedbackError::Unhandled(inner) => Error::Unhandled(inner),
336 }
337 }
338}
339impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_recommendations::ListRecommendationsError, R>> for Error
340where
341 R: Send + Sync + std::fmt::Debug + 'static,
342{
343 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_recommendations::ListRecommendationsError, R>) -> Self {
344 match err {
345 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
346 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
347 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
348 source: err.into(),
349 }),
350 }
351 }
352}
353impl From<crate::operation::list_recommendations::ListRecommendationsError> for Error {
354 fn from(err: crate::operation::list_recommendations::ListRecommendationsError) -> Self {
355 match err {
356 crate::operation::list_recommendations::ListRecommendationsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
357 crate::operation::list_recommendations::ListRecommendationsError::InternalServerException(inner) => Error::InternalServerException(inner),
358 crate::operation::list_recommendations::ListRecommendationsError::ResourceNotFoundException(inner) => {
359 Error::ResourceNotFoundException(inner)
360 }
361 crate::operation::list_recommendations::ListRecommendationsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
362 crate::operation::list_recommendations::ListRecommendationsError::ValidationException(inner) => Error::ValidationException(inner),
363 crate::operation::list_recommendations::ListRecommendationsError::Unhandled(inner) => Error::Unhandled(inner),
364 }
365 }
366}
367impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_repository_associations::ListRepositoryAssociationsError, R>>
368 for Error
369where
370 R: Send + Sync + std::fmt::Debug + 'static,
371{
372 fn from(
373 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_repository_associations::ListRepositoryAssociationsError, R>,
374 ) -> Self {
375 match err {
376 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
377 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
378 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
379 source: err.into(),
380 }),
381 }
382 }
383}
384impl From<crate::operation::list_repository_associations::ListRepositoryAssociationsError> for Error {
385 fn from(err: crate::operation::list_repository_associations::ListRepositoryAssociationsError) -> Self {
386 match err {
387 crate::operation::list_repository_associations::ListRepositoryAssociationsError::InternalServerException(inner) => {
388 Error::InternalServerException(inner)
389 }
390 crate::operation::list_repository_associations::ListRepositoryAssociationsError::ThrottlingException(inner) => {
391 Error::ThrottlingException(inner)
392 }
393 crate::operation::list_repository_associations::ListRepositoryAssociationsError::ValidationException(inner) => {
394 Error::ValidationException(inner)
395 }
396 crate::operation::list_repository_associations::ListRepositoryAssociationsError::Unhandled(inner) => Error::Unhandled(inner),
397 }
398 }
399}
400impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
401where
402 R: Send + Sync + std::fmt::Debug + 'static,
403{
404 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
405 match err {
406 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
407 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
408 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
409 source: err.into(),
410 }),
411 }
412 }
413}
414impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
415 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
416 match err {
417 crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => {
418 Error::InternalServerException(inner)
419 }
420 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
421 Error::ResourceNotFoundException(inner)
422 }
423 crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
424 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
425 }
426 }
427}
428impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError, R>>
429 for Error
430where
431 R: Send + Sync + std::fmt::Debug + 'static,
432{
433 fn from(
434 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError, R>,
435 ) -> Self {
436 match err {
437 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
438 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
439 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
440 source: err.into(),
441 }),
442 }
443 }
444}
445impl From<crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError> for Error {
446 fn from(err: crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError) -> Self {
447 match err {
448 crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError::AccessDeniedException(inner) => {
449 Error::AccessDeniedException(inner)
450 }
451 crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError::InternalServerException(inner) => {
452 Error::InternalServerException(inner)
453 }
454 crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError::ResourceNotFoundException(inner) => {
455 Error::ResourceNotFoundException(inner)
456 }
457 crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError::ThrottlingException(inner) => {
458 Error::ThrottlingException(inner)
459 }
460 crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError::ValidationException(inner) => {
461 Error::ValidationException(inner)
462 }
463 crate::operation::put_recommendation_feedback::PutRecommendationFeedbackError::Unhandled(inner) => Error::Unhandled(inner),
464 }
465 }
466}
467impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
468where
469 R: Send + Sync + std::fmt::Debug + 'static,
470{
471 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
472 match err {
473 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
474 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
475 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
476 source: err.into(),
477 }),
478 }
479 }
480}
481impl From<crate::operation::tag_resource::TagResourceError> for Error {
482 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
483 match err {
484 crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
485 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
486 crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
487 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
488 }
489 }
490}
491impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
492where
493 R: Send + Sync + std::fmt::Debug + 'static,
494{
495 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
496 match err {
497 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
498 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
499 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
500 source: err.into(),
501 }),
502 }
503 }
504}
505impl From<crate::operation::untag_resource::UntagResourceError> for Error {
506 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
507 match err {
508 crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
509 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
510 crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
511 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
512 }
513 }
514}
515impl<O, E> ::std::convert::From<::aws_smithy_runtime_api::client::waiters::error::WaiterError<O, E>> for Error
516where
517 O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
518 E: ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static,
519{
520 fn from(err: ::aws_smithy_runtime_api::client::waiters::error::WaiterError<O, E>) -> Self {
521 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
522 meta: ::std::default::Default::default(),
523 source: err.into(),
524 })
525 }
526}
527impl ::std::error::Error for Error {
528 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
529 match self {
530 Error::AccessDeniedException(inner) => inner.source(),
531 Error::ConflictException(inner) => inner.source(),
532 Error::InternalServerException(inner) => inner.source(),
533 Error::NotFoundException(inner) => inner.source(),
534 Error::ResourceNotFoundException(inner) => inner.source(),
535 Error::ThrottlingException(inner) => inner.source(),
536 Error::ValidationException(inner) => inner.source(),
537 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
538 }
539 }
540}
541impl ::aws_types::request_id::RequestId for Error {
542 fn request_id(&self) -> Option<&str> {
543 match self {
544 Self::AccessDeniedException(e) => e.request_id(),
545 Self::ConflictException(e) => e.request_id(),
546 Self::InternalServerException(e) => e.request_id(),
547 Self::NotFoundException(e) => e.request_id(),
548 Self::ResourceNotFoundException(e) => e.request_id(),
549 Self::ThrottlingException(e) => e.request_id(),
550 Self::ValidationException(e) => e.request_id(),
551 Self::Unhandled(e) => e.meta.request_id(),
552 }
553 }
554}