1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 AttachmentIdNotFound(crate::types::error::AttachmentIdNotFound),
8 AttachmentLimitExceeded(crate::types::error::AttachmentLimitExceeded),
10 AttachmentSetExpired(crate::types::error::AttachmentSetExpired),
12 AttachmentSetIdNotFound(crate::types::error::AttachmentSetIdNotFound),
14 AttachmentSetSizeLimitExceeded(crate::types::error::AttachmentSetSizeLimitExceeded),
16 CaseCreationLimitExceeded(crate::types::error::CaseCreationLimitExceeded),
18 CaseIdNotFound(crate::types::error::CaseIdNotFound),
20 DescribeAttachmentLimitExceeded(crate::types::error::DescribeAttachmentLimitExceeded),
22 InternalServerError(crate::types::error::InternalServerError),
24 ThrottlingException(crate::types::error::ThrottlingException),
26 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
28 variable wildcard pattern and check `.code()`:
29 \
30 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
31 \
32 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
33 Unhandled(crate::error::sealed_unhandled::Unhandled),
34}
35impl ::std::fmt::Display for Error {
36 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37 match self {
38 Error::AttachmentIdNotFound(inner) => inner.fmt(f),
39 Error::AttachmentLimitExceeded(inner) => inner.fmt(f),
40 Error::AttachmentSetExpired(inner) => inner.fmt(f),
41 Error::AttachmentSetIdNotFound(inner) => inner.fmt(f),
42 Error::AttachmentSetSizeLimitExceeded(inner) => inner.fmt(f),
43 Error::CaseCreationLimitExceeded(inner) => inner.fmt(f),
44 Error::CaseIdNotFound(inner) => inner.fmt(f),
45 Error::DescribeAttachmentLimitExceeded(inner) => inner.fmt(f),
46 Error::InternalServerError(inner) => inner.fmt(f),
47 Error::ThrottlingException(inner) => inner.fmt(f),
48 Error::Unhandled(_) => {
49 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
50 write!(f, "unhandled error ({code})")
51 } else {
52 f.write_str("unhandled error")
53 }
54 }
55 }
56 }
57}
58impl From<::aws_smithy_types::error::operation::BuildError> for Error {
59 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
60 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
61 source: value.into(),
62 meta: ::std::default::Default::default(),
63 })
64 }
65}
66impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
67 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
68 match self {
69 Self::AttachmentIdNotFound(inner) => inner.meta(),
70 Self::AttachmentLimitExceeded(inner) => inner.meta(),
71 Self::AttachmentSetExpired(inner) => inner.meta(),
72 Self::AttachmentSetIdNotFound(inner) => inner.meta(),
73 Self::AttachmentSetSizeLimitExceeded(inner) => inner.meta(),
74 Self::CaseCreationLimitExceeded(inner) => inner.meta(),
75 Self::CaseIdNotFound(inner) => inner.meta(),
76 Self::DescribeAttachmentLimitExceeded(inner) => inner.meta(),
77 Self::InternalServerError(inner) => inner.meta(),
78 Self::ThrottlingException(inner) => inner.meta(),
79 Self::Unhandled(inner) => &inner.meta,
80 }
81 }
82}
83impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_attachments_to_set::AddAttachmentsToSetError, R>> for Error
84where
85 R: Send + Sync + std::fmt::Debug + 'static,
86{
87 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_attachments_to_set::AddAttachmentsToSetError, R>) -> Self {
88 match err {
89 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
90 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
91 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
92 source: err.into(),
93 }),
94 }
95 }
96}
97impl From<crate::operation::add_attachments_to_set::AddAttachmentsToSetError> for Error {
98 fn from(err: crate::operation::add_attachments_to_set::AddAttachmentsToSetError) -> Self {
99 match err {
100 crate::operation::add_attachments_to_set::AddAttachmentsToSetError::AttachmentLimitExceeded(inner) => {
101 Error::AttachmentLimitExceeded(inner)
102 }
103 crate::operation::add_attachments_to_set::AddAttachmentsToSetError::AttachmentSetExpired(inner) => Error::AttachmentSetExpired(inner),
104 crate::operation::add_attachments_to_set::AddAttachmentsToSetError::AttachmentSetIdNotFound(inner) => {
105 Error::AttachmentSetIdNotFound(inner)
106 }
107 crate::operation::add_attachments_to_set::AddAttachmentsToSetError::AttachmentSetSizeLimitExceeded(inner) => {
108 Error::AttachmentSetSizeLimitExceeded(inner)
109 }
110 crate::operation::add_attachments_to_set::AddAttachmentsToSetError::InternalServerError(inner) => Error::InternalServerError(inner),
111 crate::operation::add_attachments_to_set::AddAttachmentsToSetError::Unhandled(inner) => Error::Unhandled(inner),
112 }
113 }
114}
115impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_communication_to_case::AddCommunicationToCaseError, R>>
116 for Error
117where
118 R: Send + Sync + std::fmt::Debug + 'static,
119{
120 fn from(
121 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_communication_to_case::AddCommunicationToCaseError, R>,
122 ) -> Self {
123 match err {
124 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
125 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
126 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
127 source: err.into(),
128 }),
129 }
130 }
131}
132impl From<crate::operation::add_communication_to_case::AddCommunicationToCaseError> for Error {
133 fn from(err: crate::operation::add_communication_to_case::AddCommunicationToCaseError) -> Self {
134 match err {
135 crate::operation::add_communication_to_case::AddCommunicationToCaseError::AttachmentSetExpired(inner) => {
136 Error::AttachmentSetExpired(inner)
137 }
138 crate::operation::add_communication_to_case::AddCommunicationToCaseError::AttachmentSetIdNotFound(inner) => {
139 Error::AttachmentSetIdNotFound(inner)
140 }
141 crate::operation::add_communication_to_case::AddCommunicationToCaseError::CaseIdNotFound(inner) => Error::CaseIdNotFound(inner),
142 crate::operation::add_communication_to_case::AddCommunicationToCaseError::InternalServerError(inner) => Error::InternalServerError(inner),
143 crate::operation::add_communication_to_case::AddCommunicationToCaseError::Unhandled(inner) => Error::Unhandled(inner),
144 }
145 }
146}
147impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_case::CreateCaseError, R>> for Error
148where
149 R: Send + Sync + std::fmt::Debug + 'static,
150{
151 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_case::CreateCaseError, R>) -> Self {
152 match err {
153 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
154 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
155 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
156 source: err.into(),
157 }),
158 }
159 }
160}
161impl From<crate::operation::create_case::CreateCaseError> for Error {
162 fn from(err: crate::operation::create_case::CreateCaseError) -> Self {
163 match err {
164 crate::operation::create_case::CreateCaseError::AttachmentSetExpired(inner) => Error::AttachmentSetExpired(inner),
165 crate::operation::create_case::CreateCaseError::AttachmentSetIdNotFound(inner) => Error::AttachmentSetIdNotFound(inner),
166 crate::operation::create_case::CreateCaseError::CaseCreationLimitExceeded(inner) => Error::CaseCreationLimitExceeded(inner),
167 crate::operation::create_case::CreateCaseError::InternalServerError(inner) => Error::InternalServerError(inner),
168 crate::operation::create_case::CreateCaseError::Unhandled(inner) => Error::Unhandled(inner),
169 }
170 }
171}
172impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_attachment::DescribeAttachmentError, R>> for Error
173where
174 R: Send + Sync + std::fmt::Debug + 'static,
175{
176 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_attachment::DescribeAttachmentError, R>) -> Self {
177 match err {
178 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
179 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
180 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
181 source: err.into(),
182 }),
183 }
184 }
185}
186impl From<crate::operation::describe_attachment::DescribeAttachmentError> for Error {
187 fn from(err: crate::operation::describe_attachment::DescribeAttachmentError) -> Self {
188 match err {
189 crate::operation::describe_attachment::DescribeAttachmentError::AttachmentIdNotFound(inner) => Error::AttachmentIdNotFound(inner),
190 crate::operation::describe_attachment::DescribeAttachmentError::DescribeAttachmentLimitExceeded(inner) => {
191 Error::DescribeAttachmentLimitExceeded(inner)
192 }
193 crate::operation::describe_attachment::DescribeAttachmentError::InternalServerError(inner) => Error::InternalServerError(inner),
194 crate::operation::describe_attachment::DescribeAttachmentError::Unhandled(inner) => Error::Unhandled(inner),
195 }
196 }
197}
198impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_cases::DescribeCasesError, R>> for Error
199where
200 R: Send + Sync + std::fmt::Debug + 'static,
201{
202 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_cases::DescribeCasesError, R>) -> Self {
203 match err {
204 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
205 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
206 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
207 source: err.into(),
208 }),
209 }
210 }
211}
212impl From<crate::operation::describe_cases::DescribeCasesError> for Error {
213 fn from(err: crate::operation::describe_cases::DescribeCasesError) -> Self {
214 match err {
215 crate::operation::describe_cases::DescribeCasesError::CaseIdNotFound(inner) => Error::CaseIdNotFound(inner),
216 crate::operation::describe_cases::DescribeCasesError::InternalServerError(inner) => Error::InternalServerError(inner),
217 crate::operation::describe_cases::DescribeCasesError::Unhandled(inner) => Error::Unhandled(inner),
218 }
219 }
220}
221impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_communications::DescribeCommunicationsError, R>> for Error
222where
223 R: Send + Sync + std::fmt::Debug + 'static,
224{
225 fn from(
226 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_communications::DescribeCommunicationsError, R>,
227 ) -> Self {
228 match err {
229 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
230 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
231 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
232 source: err.into(),
233 }),
234 }
235 }
236}
237impl From<crate::operation::describe_communications::DescribeCommunicationsError> for Error {
238 fn from(err: crate::operation::describe_communications::DescribeCommunicationsError) -> Self {
239 match err {
240 crate::operation::describe_communications::DescribeCommunicationsError::CaseIdNotFound(inner) => Error::CaseIdNotFound(inner),
241 crate::operation::describe_communications::DescribeCommunicationsError::InternalServerError(inner) => Error::InternalServerError(inner),
242 crate::operation::describe_communications::DescribeCommunicationsError::Unhandled(inner) => Error::Unhandled(inner),
243 }
244 }
245}
246impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_create_case_options::DescribeCreateCaseOptionsError, R>>
247 for Error
248where
249 R: Send + Sync + std::fmt::Debug + 'static,
250{
251 fn from(
252 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_create_case_options::DescribeCreateCaseOptionsError, R>,
253 ) -> Self {
254 match err {
255 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
256 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
257 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
258 source: err.into(),
259 }),
260 }
261 }
262}
263impl From<crate::operation::describe_create_case_options::DescribeCreateCaseOptionsError> for Error {
264 fn from(err: crate::operation::describe_create_case_options::DescribeCreateCaseOptionsError) -> Self {
265 match err {
266 crate::operation::describe_create_case_options::DescribeCreateCaseOptionsError::InternalServerError(inner) => {
267 Error::InternalServerError(inner)
268 }
269 crate::operation::describe_create_case_options::DescribeCreateCaseOptionsError::ThrottlingException(inner) => {
270 Error::ThrottlingException(inner)
271 }
272 crate::operation::describe_create_case_options::DescribeCreateCaseOptionsError::Unhandled(inner) => Error::Unhandled(inner),
273 }
274 }
275}
276impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_services::DescribeServicesError, R>> for Error
277where
278 R: Send + Sync + std::fmt::Debug + 'static,
279{
280 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_services::DescribeServicesError, R>) -> Self {
281 match err {
282 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
283 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
284 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
285 source: err.into(),
286 }),
287 }
288 }
289}
290impl From<crate::operation::describe_services::DescribeServicesError> for Error {
291 fn from(err: crate::operation::describe_services::DescribeServicesError) -> Self {
292 match err {
293 crate::operation::describe_services::DescribeServicesError::InternalServerError(inner) => Error::InternalServerError(inner),
294 crate::operation::describe_services::DescribeServicesError::Unhandled(inner) => Error::Unhandled(inner),
295 }
296 }
297}
298impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_severity_levels::DescribeSeverityLevelsError, R>> for Error
299where
300 R: Send + Sync + std::fmt::Debug + 'static,
301{
302 fn from(
303 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_severity_levels::DescribeSeverityLevelsError, R>,
304 ) -> Self {
305 match err {
306 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
307 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
308 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
309 source: err.into(),
310 }),
311 }
312 }
313}
314impl From<crate::operation::describe_severity_levels::DescribeSeverityLevelsError> for Error {
315 fn from(err: crate::operation::describe_severity_levels::DescribeSeverityLevelsError) -> Self {
316 match err {
317 crate::operation::describe_severity_levels::DescribeSeverityLevelsError::InternalServerError(inner) => Error::InternalServerError(inner),
318 crate::operation::describe_severity_levels::DescribeSeverityLevelsError::Unhandled(inner) => Error::Unhandled(inner),
319 }
320 }
321}
322impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_supported_languages::DescribeSupportedLanguagesError, R>>
323 for Error
324where
325 R: Send + Sync + std::fmt::Debug + 'static,
326{
327 fn from(
328 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_supported_languages::DescribeSupportedLanguagesError, R>,
329 ) -> Self {
330 match err {
331 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
332 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
333 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
334 source: err.into(),
335 }),
336 }
337 }
338}
339impl From<crate::operation::describe_supported_languages::DescribeSupportedLanguagesError> for Error {
340 fn from(err: crate::operation::describe_supported_languages::DescribeSupportedLanguagesError) -> Self {
341 match err {
342 crate::operation::describe_supported_languages::DescribeSupportedLanguagesError::InternalServerError(inner) => {
343 Error::InternalServerError(inner)
344 }
345 crate::operation::describe_supported_languages::DescribeSupportedLanguagesError::ThrottlingException(inner) => {
346 Error::ThrottlingException(inner)
347 }
348 crate::operation::describe_supported_languages::DescribeSupportedLanguagesError::Unhandled(inner) => Error::Unhandled(inner),
349 }
350 }
351}
352impl<R>
353 From<
354 ::aws_smithy_runtime_api::client::result::SdkError<
355 crate::operation::describe_trusted_advisor_check_refresh_statuses::DescribeTrustedAdvisorCheckRefreshStatusesError,
356 R,
357 >,
358 > for Error
359where
360 R: Send + Sync + std::fmt::Debug + 'static,
361{
362 fn from(
363 err: ::aws_smithy_runtime_api::client::result::SdkError<
364 crate::operation::describe_trusted_advisor_check_refresh_statuses::DescribeTrustedAdvisorCheckRefreshStatusesError,
365 R,
366 >,
367 ) -> Self {
368 match err {
369 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
370 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
371 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
372 source: err.into(),
373 }),
374 }
375 }
376}
377impl From<crate::operation::describe_trusted_advisor_check_refresh_statuses::DescribeTrustedAdvisorCheckRefreshStatusesError> for Error {
378 fn from(err: crate::operation::describe_trusted_advisor_check_refresh_statuses::DescribeTrustedAdvisorCheckRefreshStatusesError) -> Self {
379 match err {
380 crate::operation::describe_trusted_advisor_check_refresh_statuses::DescribeTrustedAdvisorCheckRefreshStatusesError::InternalServerError(inner) => Error::InternalServerError(inner),
381 crate::operation::describe_trusted_advisor_check_refresh_statuses::DescribeTrustedAdvisorCheckRefreshStatusesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
382 crate::operation::describe_trusted_advisor_check_refresh_statuses::DescribeTrustedAdvisorCheckRefreshStatusesError::Unhandled(inner) => Error::Unhandled(inner),
383 }
384 }
385}
386impl<R>
387 From<
388 ::aws_smithy_runtime_api::client::result::SdkError<
389 crate::operation::describe_trusted_advisor_check_result::DescribeTrustedAdvisorCheckResultError,
390 R,
391 >,
392 > for Error
393where
394 R: Send + Sync + std::fmt::Debug + 'static,
395{
396 fn from(
397 err: ::aws_smithy_runtime_api::client::result::SdkError<
398 crate::operation::describe_trusted_advisor_check_result::DescribeTrustedAdvisorCheckResultError,
399 R,
400 >,
401 ) -> Self {
402 match err {
403 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
404 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
405 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
406 source: err.into(),
407 }),
408 }
409 }
410}
411impl From<crate::operation::describe_trusted_advisor_check_result::DescribeTrustedAdvisorCheckResultError> for Error {
412 fn from(err: crate::operation::describe_trusted_advisor_check_result::DescribeTrustedAdvisorCheckResultError) -> Self {
413 match err {
414 crate::operation::describe_trusted_advisor_check_result::DescribeTrustedAdvisorCheckResultError::InternalServerError(inner) => {
415 Error::InternalServerError(inner)
416 }
417 crate::operation::describe_trusted_advisor_check_result::DescribeTrustedAdvisorCheckResultError::ThrottlingException(inner) => {
418 Error::ThrottlingException(inner)
419 }
420 crate::operation::describe_trusted_advisor_check_result::DescribeTrustedAdvisorCheckResultError::Unhandled(inner) => {
421 Error::Unhandled(inner)
422 }
423 }
424 }
425}
426impl<R>
427 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_trusted_advisor_checks::DescribeTrustedAdvisorChecksError, R>>
428 for Error
429where
430 R: Send + Sync + std::fmt::Debug + 'static,
431{
432 fn from(
433 err: ::aws_smithy_runtime_api::client::result::SdkError<
434 crate::operation::describe_trusted_advisor_checks::DescribeTrustedAdvisorChecksError,
435 R,
436 >,
437 ) -> Self {
438 match err {
439 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
440 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
441 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
442 source: err.into(),
443 }),
444 }
445 }
446}
447impl From<crate::operation::describe_trusted_advisor_checks::DescribeTrustedAdvisorChecksError> for Error {
448 fn from(err: crate::operation::describe_trusted_advisor_checks::DescribeTrustedAdvisorChecksError) -> Self {
449 match err {
450 crate::operation::describe_trusted_advisor_checks::DescribeTrustedAdvisorChecksError::InternalServerError(inner) => {
451 Error::InternalServerError(inner)
452 }
453 crate::operation::describe_trusted_advisor_checks::DescribeTrustedAdvisorChecksError::ThrottlingException(inner) => {
454 Error::ThrottlingException(inner)
455 }
456 crate::operation::describe_trusted_advisor_checks::DescribeTrustedAdvisorChecksError::Unhandled(inner) => Error::Unhandled(inner),
457 }
458 }
459}
460impl<R>
461 From<
462 ::aws_smithy_runtime_api::client::result::SdkError<
463 crate::operation::describe_trusted_advisor_check_summaries::DescribeTrustedAdvisorCheckSummariesError,
464 R,
465 >,
466 > for Error
467where
468 R: Send + Sync + std::fmt::Debug + 'static,
469{
470 fn from(
471 err: ::aws_smithy_runtime_api::client::result::SdkError<
472 crate::operation::describe_trusted_advisor_check_summaries::DescribeTrustedAdvisorCheckSummariesError,
473 R,
474 >,
475 ) -> Self {
476 match err {
477 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
478 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
479 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
480 source: err.into(),
481 }),
482 }
483 }
484}
485impl From<crate::operation::describe_trusted_advisor_check_summaries::DescribeTrustedAdvisorCheckSummariesError> for Error {
486 fn from(err: crate::operation::describe_trusted_advisor_check_summaries::DescribeTrustedAdvisorCheckSummariesError) -> Self {
487 match err {
488 crate::operation::describe_trusted_advisor_check_summaries::DescribeTrustedAdvisorCheckSummariesError::InternalServerError(inner) => {
489 Error::InternalServerError(inner)
490 }
491 crate::operation::describe_trusted_advisor_check_summaries::DescribeTrustedAdvisorCheckSummariesError::ThrottlingException(inner) => {
492 Error::ThrottlingException(inner)
493 }
494 crate::operation::describe_trusted_advisor_check_summaries::DescribeTrustedAdvisorCheckSummariesError::Unhandled(inner) => {
495 Error::Unhandled(inner)
496 }
497 }
498 }
499}
500impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::refresh_trusted_advisor_check::RefreshTrustedAdvisorCheckError, R>>
501 for Error
502where
503 R: Send + Sync + std::fmt::Debug + 'static,
504{
505 fn from(
506 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::refresh_trusted_advisor_check::RefreshTrustedAdvisorCheckError, R>,
507 ) -> Self {
508 match err {
509 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
510 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
511 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
512 source: err.into(),
513 }),
514 }
515 }
516}
517impl From<crate::operation::refresh_trusted_advisor_check::RefreshTrustedAdvisorCheckError> for Error {
518 fn from(err: crate::operation::refresh_trusted_advisor_check::RefreshTrustedAdvisorCheckError) -> Self {
519 match err {
520 crate::operation::refresh_trusted_advisor_check::RefreshTrustedAdvisorCheckError::InternalServerError(inner) => {
521 Error::InternalServerError(inner)
522 }
523 crate::operation::refresh_trusted_advisor_check::RefreshTrustedAdvisorCheckError::Unhandled(inner) => Error::Unhandled(inner),
524 }
525 }
526}
527impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::resolve_case::ResolveCaseError, R>> for Error
528where
529 R: Send + Sync + std::fmt::Debug + 'static,
530{
531 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::resolve_case::ResolveCaseError, R>) -> Self {
532 match err {
533 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
534 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
535 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
536 source: err.into(),
537 }),
538 }
539 }
540}
541impl From<crate::operation::resolve_case::ResolveCaseError> for Error {
542 fn from(err: crate::operation::resolve_case::ResolveCaseError) -> Self {
543 match err {
544 crate::operation::resolve_case::ResolveCaseError::CaseIdNotFound(inner) => Error::CaseIdNotFound(inner),
545 crate::operation::resolve_case::ResolveCaseError::InternalServerError(inner) => Error::InternalServerError(inner),
546 crate::operation::resolve_case::ResolveCaseError::Unhandled(inner) => Error::Unhandled(inner),
547 }
548 }
549}
550impl ::std::error::Error for Error {
551 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
552 match self {
553 Error::AttachmentIdNotFound(inner) => inner.source(),
554 Error::AttachmentLimitExceeded(inner) => inner.source(),
555 Error::AttachmentSetExpired(inner) => inner.source(),
556 Error::AttachmentSetIdNotFound(inner) => inner.source(),
557 Error::AttachmentSetSizeLimitExceeded(inner) => inner.source(),
558 Error::CaseCreationLimitExceeded(inner) => inner.source(),
559 Error::CaseIdNotFound(inner) => inner.source(),
560 Error::DescribeAttachmentLimitExceeded(inner) => inner.source(),
561 Error::InternalServerError(inner) => inner.source(),
562 Error::ThrottlingException(inner) => inner.source(),
563 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
564 }
565 }
566}
567impl ::aws_types::request_id::RequestId for Error {
568 fn request_id(&self) -> Option<&str> {
569 match self {
570 Self::AttachmentIdNotFound(e) => e.request_id(),
571 Self::AttachmentLimitExceeded(e) => e.request_id(),
572 Self::AttachmentSetExpired(e) => e.request_id(),
573 Self::AttachmentSetIdNotFound(e) => e.request_id(),
574 Self::AttachmentSetSizeLimitExceeded(e) => e.request_id(),
575 Self::CaseCreationLimitExceeded(e) => e.request_id(),
576 Self::CaseIdNotFound(e) => e.request_id(),
577 Self::DescribeAttachmentLimitExceeded(e) => e.request_id(),
578 Self::InternalServerError(e) => e.request_id(),
579 Self::ThrottlingException(e) => e.request_id(),
580 Self::Unhandled(e) => e.meta.request_id(),
581 }
582 }
583}