aws_sdk_batch/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// <p>These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.</p>
7    ClientException(crate::types::error::ClientException),
8    /// <p>These errors are usually caused by a server issue.</p>
9    ServerException(crate::types::error::ServerException),
10    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
11    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
12    variable wildcard pattern and check `.code()`:
13     \
14    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
15     \
16    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
17    Unhandled(crate::error::sealed_unhandled::Unhandled),
18}
19impl ::std::fmt::Display for Error {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21        match self {
22            Error::ClientException(inner) => inner.fmt(f),
23            Error::ServerException(inner) => inner.fmt(f),
24            Error::Unhandled(_) => {
25                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
26                    write!(f, "unhandled error ({code})")
27                } else {
28                    f.write_str("unhandled error")
29                }
30            }
31        }
32    }
33}
34impl From<::aws_smithy_types::error::operation::BuildError> for Error {
35    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
36        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
37            source: value.into(),
38            meta: ::std::default::Default::default(),
39        })
40    }
41}
42impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
43    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
44        match self {
45            Self::ClientException(inner) => inner.meta(),
46            Self::ServerException(inner) => inner.meta(),
47            Self::Unhandled(inner) => &inner.meta,
48        }
49    }
50}
51impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::cancel_job::CancelJobError, R>> for Error
52where
53    R: Send + Sync + std::fmt::Debug + 'static,
54{
55    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::cancel_job::CancelJobError, R>) -> Self {
56        match err {
57            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
58            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
59                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
60                source: err.into(),
61            }),
62        }
63    }
64}
65impl From<crate::operation::cancel_job::CancelJobError> for Error {
66    fn from(err: crate::operation::cancel_job::CancelJobError) -> Self {
67        match err {
68            crate::operation::cancel_job::CancelJobError::ClientException(inner) => Error::ClientException(inner),
69            crate::operation::cancel_job::CancelJobError::ServerException(inner) => Error::ServerException(inner),
70            crate::operation::cancel_job::CancelJobError::Unhandled(inner) => Error::Unhandled(inner),
71        }
72    }
73}
74impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_compute_environment::CreateComputeEnvironmentError, R>>
75    for Error
76where
77    R: Send + Sync + std::fmt::Debug + 'static,
78{
79    fn from(
80        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_compute_environment::CreateComputeEnvironmentError, R>,
81    ) -> Self {
82        match err {
83            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
84            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
85                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
86                source: err.into(),
87            }),
88        }
89    }
90}
91impl From<crate::operation::create_compute_environment::CreateComputeEnvironmentError> for Error {
92    fn from(err: crate::operation::create_compute_environment::CreateComputeEnvironmentError) -> Self {
93        match err {
94            crate::operation::create_compute_environment::CreateComputeEnvironmentError::ClientException(inner) => Error::ClientException(inner),
95            crate::operation::create_compute_environment::CreateComputeEnvironmentError::ServerException(inner) => Error::ServerException(inner),
96            crate::operation::create_compute_environment::CreateComputeEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
97        }
98    }
99}
100impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_consumable_resource::CreateConsumableResourceError, R>>
101    for Error
102where
103    R: Send + Sync + std::fmt::Debug + 'static,
104{
105    fn from(
106        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_consumable_resource::CreateConsumableResourceError, R>,
107    ) -> Self {
108        match err {
109            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
110            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
111                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
112                source: err.into(),
113            }),
114        }
115    }
116}
117impl From<crate::operation::create_consumable_resource::CreateConsumableResourceError> for Error {
118    fn from(err: crate::operation::create_consumable_resource::CreateConsumableResourceError) -> Self {
119        match err {
120            crate::operation::create_consumable_resource::CreateConsumableResourceError::ClientException(inner) => Error::ClientException(inner),
121            crate::operation::create_consumable_resource::CreateConsumableResourceError::ServerException(inner) => Error::ServerException(inner),
122            crate::operation::create_consumable_resource::CreateConsumableResourceError::Unhandled(inner) => Error::Unhandled(inner),
123        }
124    }
125}
126impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_job_queue::CreateJobQueueError, R>> for Error
127where
128    R: Send + Sync + std::fmt::Debug + 'static,
129{
130    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_job_queue::CreateJobQueueError, R>) -> Self {
131        match err {
132            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
133            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
134                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
135                source: err.into(),
136            }),
137        }
138    }
139}
140impl From<crate::operation::create_job_queue::CreateJobQueueError> for Error {
141    fn from(err: crate::operation::create_job_queue::CreateJobQueueError) -> Self {
142        match err {
143            crate::operation::create_job_queue::CreateJobQueueError::ClientException(inner) => Error::ClientException(inner),
144            crate::operation::create_job_queue::CreateJobQueueError::ServerException(inner) => Error::ServerException(inner),
145            crate::operation::create_job_queue::CreateJobQueueError::Unhandled(inner) => Error::Unhandled(inner),
146        }
147    }
148}
149impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_scheduling_policy::CreateSchedulingPolicyError, R>> for Error
150where
151    R: Send + Sync + std::fmt::Debug + 'static,
152{
153    fn from(
154        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_scheduling_policy::CreateSchedulingPolicyError, R>,
155    ) -> Self {
156        match err {
157            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
158            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
159                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
160                source: err.into(),
161            }),
162        }
163    }
164}
165impl From<crate::operation::create_scheduling_policy::CreateSchedulingPolicyError> for Error {
166    fn from(err: crate::operation::create_scheduling_policy::CreateSchedulingPolicyError) -> Self {
167        match err {
168            crate::operation::create_scheduling_policy::CreateSchedulingPolicyError::ClientException(inner) => Error::ClientException(inner),
169            crate::operation::create_scheduling_policy::CreateSchedulingPolicyError::ServerException(inner) => Error::ServerException(inner),
170            crate::operation::create_scheduling_policy::CreateSchedulingPolicyError::Unhandled(inner) => Error::Unhandled(inner),
171        }
172    }
173}
174impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_compute_environment::DeleteComputeEnvironmentError, R>>
175    for Error
176where
177    R: Send + Sync + std::fmt::Debug + 'static,
178{
179    fn from(
180        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_compute_environment::DeleteComputeEnvironmentError, R>,
181    ) -> Self {
182        match err {
183            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
184            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
185                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
186                source: err.into(),
187            }),
188        }
189    }
190}
191impl From<crate::operation::delete_compute_environment::DeleteComputeEnvironmentError> for Error {
192    fn from(err: crate::operation::delete_compute_environment::DeleteComputeEnvironmentError) -> Self {
193        match err {
194            crate::operation::delete_compute_environment::DeleteComputeEnvironmentError::ClientException(inner) => Error::ClientException(inner),
195            crate::operation::delete_compute_environment::DeleteComputeEnvironmentError::ServerException(inner) => Error::ServerException(inner),
196            crate::operation::delete_compute_environment::DeleteComputeEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
197        }
198    }
199}
200impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_consumable_resource::DeleteConsumableResourceError, 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<crate::operation::delete_consumable_resource::DeleteConsumableResourceError, R>,
207    ) -> Self {
208        match err {
209            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
210            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
211                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
212                source: err.into(),
213            }),
214        }
215    }
216}
217impl From<crate::operation::delete_consumable_resource::DeleteConsumableResourceError> for Error {
218    fn from(err: crate::operation::delete_consumable_resource::DeleteConsumableResourceError) -> Self {
219        match err {
220            crate::operation::delete_consumable_resource::DeleteConsumableResourceError::ClientException(inner) => Error::ClientException(inner),
221            crate::operation::delete_consumable_resource::DeleteConsumableResourceError::ServerException(inner) => Error::ServerException(inner),
222            crate::operation::delete_consumable_resource::DeleteConsumableResourceError::Unhandled(inner) => Error::Unhandled(inner),
223        }
224    }
225}
226impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_job_queue::DeleteJobQueueError, R>> for Error
227where
228    R: Send + Sync + std::fmt::Debug + 'static,
229{
230    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_job_queue::DeleteJobQueueError, R>) -> Self {
231        match err {
232            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
233            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
234                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
235                source: err.into(),
236            }),
237        }
238    }
239}
240impl From<crate::operation::delete_job_queue::DeleteJobQueueError> for Error {
241    fn from(err: crate::operation::delete_job_queue::DeleteJobQueueError) -> Self {
242        match err {
243            crate::operation::delete_job_queue::DeleteJobQueueError::ClientException(inner) => Error::ClientException(inner),
244            crate::operation::delete_job_queue::DeleteJobQueueError::ServerException(inner) => Error::ServerException(inner),
245            crate::operation::delete_job_queue::DeleteJobQueueError::Unhandled(inner) => Error::Unhandled(inner),
246        }
247    }
248}
249impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError, R>> for Error
250where
251    R: Send + Sync + std::fmt::Debug + 'static,
252{
253    fn from(
254        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError, R>,
255    ) -> Self {
256        match err {
257            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
258            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
259                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
260                source: err.into(),
261            }),
262        }
263    }
264}
265impl From<crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError> for Error {
266    fn from(err: crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError) -> Self {
267        match err {
268            crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError::ClientException(inner) => Error::ClientException(inner),
269            crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError::ServerException(inner) => Error::ServerException(inner),
270            crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError::Unhandled(inner) => Error::Unhandled(inner),
271        }
272    }
273}
274impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::deregister_job_definition::DeregisterJobDefinitionError, R>>
275    for Error
276where
277    R: Send + Sync + std::fmt::Debug + 'static,
278{
279    fn from(
280        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::deregister_job_definition::DeregisterJobDefinitionError, R>,
281    ) -> Self {
282        match err {
283            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
284            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
285                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
286                source: err.into(),
287            }),
288        }
289    }
290}
291impl From<crate::operation::deregister_job_definition::DeregisterJobDefinitionError> for Error {
292    fn from(err: crate::operation::deregister_job_definition::DeregisterJobDefinitionError) -> Self {
293        match err {
294            crate::operation::deregister_job_definition::DeregisterJobDefinitionError::ClientException(inner) => Error::ClientException(inner),
295            crate::operation::deregister_job_definition::DeregisterJobDefinitionError::ServerException(inner) => Error::ServerException(inner),
296            crate::operation::deregister_job_definition::DeregisterJobDefinitionError::Unhandled(inner) => Error::Unhandled(inner),
297        }
298    }
299}
300impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError, 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::describe_compute_environments::DescribeComputeEnvironmentsError, 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::describe_compute_environments::DescribeComputeEnvironmentsError> for Error {
318    fn from(err: crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError) -> Self {
319        match err {
320            crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError::ClientException(inner) => {
321                Error::ClientException(inner)
322            }
323            crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError::ServerException(inner) => {
324                Error::ServerException(inner)
325            }
326            crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError::Unhandled(inner) => Error::Unhandled(inner),
327        }
328    }
329}
330impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_consumable_resource::DescribeConsumableResourceError, R>>
331    for Error
332where
333    R: Send + Sync + std::fmt::Debug + 'static,
334{
335    fn from(
336        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_consumable_resource::DescribeConsumableResourceError, R>,
337    ) -> Self {
338        match err {
339            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
340            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
341                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
342                source: err.into(),
343            }),
344        }
345    }
346}
347impl From<crate::operation::describe_consumable_resource::DescribeConsumableResourceError> for Error {
348    fn from(err: crate::operation::describe_consumable_resource::DescribeConsumableResourceError) -> Self {
349        match err {
350            crate::operation::describe_consumable_resource::DescribeConsumableResourceError::ClientException(inner) => Error::ClientException(inner),
351            crate::operation::describe_consumable_resource::DescribeConsumableResourceError::ServerException(inner) => Error::ServerException(inner),
352            crate::operation::describe_consumable_resource::DescribeConsumableResourceError::Unhandled(inner) => Error::Unhandled(inner),
353        }
354    }
355}
356impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_definitions::DescribeJobDefinitionsError, R>> for Error
357where
358    R: Send + Sync + std::fmt::Debug + 'static,
359{
360    fn from(
361        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_definitions::DescribeJobDefinitionsError, R>,
362    ) -> Self {
363        match err {
364            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
365            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
366                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
367                source: err.into(),
368            }),
369        }
370    }
371}
372impl From<crate::operation::describe_job_definitions::DescribeJobDefinitionsError> for Error {
373    fn from(err: crate::operation::describe_job_definitions::DescribeJobDefinitionsError) -> Self {
374        match err {
375            crate::operation::describe_job_definitions::DescribeJobDefinitionsError::ClientException(inner) => Error::ClientException(inner),
376            crate::operation::describe_job_definitions::DescribeJobDefinitionsError::ServerException(inner) => Error::ServerException(inner),
377            crate::operation::describe_job_definitions::DescribeJobDefinitionsError::Unhandled(inner) => Error::Unhandled(inner),
378        }
379    }
380}
381impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_queues::DescribeJobQueuesError, R>> for Error
382where
383    R: Send + Sync + std::fmt::Debug + 'static,
384{
385    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_queues::DescribeJobQueuesError, R>) -> Self {
386        match err {
387            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
388            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
389                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
390                source: err.into(),
391            }),
392        }
393    }
394}
395impl From<crate::operation::describe_job_queues::DescribeJobQueuesError> for Error {
396    fn from(err: crate::operation::describe_job_queues::DescribeJobQueuesError) -> Self {
397        match err {
398            crate::operation::describe_job_queues::DescribeJobQueuesError::ClientException(inner) => Error::ClientException(inner),
399            crate::operation::describe_job_queues::DescribeJobQueuesError::ServerException(inner) => Error::ServerException(inner),
400            crate::operation::describe_job_queues::DescribeJobQueuesError::Unhandled(inner) => Error::Unhandled(inner),
401        }
402    }
403}
404impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_jobs::DescribeJobsError, R>> for Error
405where
406    R: Send + Sync + std::fmt::Debug + 'static,
407{
408    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_jobs::DescribeJobsError, R>) -> Self {
409        match err {
410            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
411            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
412                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
413                source: err.into(),
414            }),
415        }
416    }
417}
418impl From<crate::operation::describe_jobs::DescribeJobsError> for Error {
419    fn from(err: crate::operation::describe_jobs::DescribeJobsError) -> Self {
420        match err {
421            crate::operation::describe_jobs::DescribeJobsError::ClientException(inner) => Error::ClientException(inner),
422            crate::operation::describe_jobs::DescribeJobsError::ServerException(inner) => Error::ServerException(inner),
423            crate::operation::describe_jobs::DescribeJobsError::Unhandled(inner) => Error::Unhandled(inner),
424        }
425    }
426}
427impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError, 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<crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError, R>,
434    ) -> Self {
435        match err {
436            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
437            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
438                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
439                source: err.into(),
440            }),
441        }
442    }
443}
444impl From<crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError> for Error {
445    fn from(err: crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError) -> Self {
446        match err {
447            crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError::ClientException(inner) => Error::ClientException(inner),
448            crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError::ServerException(inner) => Error::ServerException(inner),
449            crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError::Unhandled(inner) => Error::Unhandled(inner),
450        }
451    }
452}
453impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError, R>> for Error
454where
455    R: Send + Sync + std::fmt::Debug + 'static,
456{
457    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError, R>) -> Self {
458        match err {
459            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
460            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
461                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
462                source: err.into(),
463            }),
464        }
465    }
466}
467impl From<crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError> for Error {
468    fn from(err: crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError) -> Self {
469        match err {
470            crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError::ClientException(inner) => Error::ClientException(inner),
471            crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError::ServerException(inner) => Error::ServerException(inner),
472            crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError::Unhandled(inner) => Error::Unhandled(inner),
473        }
474    }
475}
476impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_consumable_resources::ListConsumableResourcesError, R>>
477    for Error
478where
479    R: Send + Sync + std::fmt::Debug + 'static,
480{
481    fn from(
482        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_consumable_resources::ListConsumableResourcesError, R>,
483    ) -> 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_consumable_resources::ListConsumableResourcesError> for Error {
494    fn from(err: crate::operation::list_consumable_resources::ListConsumableResourcesError) -> Self {
495        match err {
496            crate::operation::list_consumable_resources::ListConsumableResourcesError::ClientException(inner) => Error::ClientException(inner),
497            crate::operation::list_consumable_resources::ListConsumableResourcesError::ServerException(inner) => Error::ServerException(inner),
498            crate::operation::list_consumable_resources::ListConsumableResourcesError::Unhandled(inner) => Error::Unhandled(inner),
499        }
500    }
501}
502impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_jobs::ListJobsError, R>> for Error
503where
504    R: Send + Sync + std::fmt::Debug + 'static,
505{
506    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_jobs::ListJobsError, R>) -> Self {
507        match err {
508            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
509            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
510                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
511                source: err.into(),
512            }),
513        }
514    }
515}
516impl From<crate::operation::list_jobs::ListJobsError> for Error {
517    fn from(err: crate::operation::list_jobs::ListJobsError) -> Self {
518        match err {
519            crate::operation::list_jobs::ListJobsError::ClientException(inner) => Error::ClientException(inner),
520            crate::operation::list_jobs::ListJobsError::ServerException(inner) => Error::ServerException(inner),
521            crate::operation::list_jobs::ListJobsError::Unhandled(inner) => Error::Unhandled(inner),
522        }
523    }
524}
525impl<R>
526    From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_jobs_by_consumable_resource::ListJobsByConsumableResourceError, R>>
527    for Error
528where
529    R: Send + Sync + std::fmt::Debug + 'static,
530{
531    fn from(
532        err: ::aws_smithy_runtime_api::client::result::SdkError<
533            crate::operation::list_jobs_by_consumable_resource::ListJobsByConsumableResourceError,
534            R,
535        >,
536    ) -> Self {
537        match err {
538            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
539            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
540                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
541                source: err.into(),
542            }),
543        }
544    }
545}
546impl From<crate::operation::list_jobs_by_consumable_resource::ListJobsByConsumableResourceError> for Error {
547    fn from(err: crate::operation::list_jobs_by_consumable_resource::ListJobsByConsumableResourceError) -> Self {
548        match err {
549            crate::operation::list_jobs_by_consumable_resource::ListJobsByConsumableResourceError::ClientException(inner) => {
550                Error::ClientException(inner)
551            }
552            crate::operation::list_jobs_by_consumable_resource::ListJobsByConsumableResourceError::ServerException(inner) => {
553                Error::ServerException(inner)
554            }
555            crate::operation::list_jobs_by_consumable_resource::ListJobsByConsumableResourceError::Unhandled(inner) => Error::Unhandled(inner),
556        }
557    }
558}
559impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_scheduling_policies::ListSchedulingPoliciesError, R>> for Error
560where
561    R: Send + Sync + std::fmt::Debug + 'static,
562{
563    fn from(
564        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_scheduling_policies::ListSchedulingPoliciesError, R>,
565    ) -> Self {
566        match err {
567            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
568            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
569                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
570                source: err.into(),
571            }),
572        }
573    }
574}
575impl From<crate::operation::list_scheduling_policies::ListSchedulingPoliciesError> for Error {
576    fn from(err: crate::operation::list_scheduling_policies::ListSchedulingPoliciesError) -> Self {
577        match err {
578            crate::operation::list_scheduling_policies::ListSchedulingPoliciesError::ClientException(inner) => Error::ClientException(inner),
579            crate::operation::list_scheduling_policies::ListSchedulingPoliciesError::ServerException(inner) => Error::ServerException(inner),
580            crate::operation::list_scheduling_policies::ListSchedulingPoliciesError::Unhandled(inner) => Error::Unhandled(inner),
581        }
582    }
583}
584impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
585where
586    R: Send + Sync + std::fmt::Debug + 'static,
587{
588    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
589        match err {
590            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
591            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
592                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
593                source: err.into(),
594            }),
595        }
596    }
597}
598impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
599    fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
600        match err {
601            crate::operation::list_tags_for_resource::ListTagsForResourceError::ClientException(inner) => Error::ClientException(inner),
602            crate::operation::list_tags_for_resource::ListTagsForResourceError::ServerException(inner) => Error::ServerException(inner),
603            crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
604        }
605    }
606}
607impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::register_job_definition::RegisterJobDefinitionError, R>> for Error
608where
609    R: Send + Sync + std::fmt::Debug + 'static,
610{
611    fn from(
612        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::register_job_definition::RegisterJobDefinitionError, R>,
613    ) -> Self {
614        match err {
615            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
616            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
617                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
618                source: err.into(),
619            }),
620        }
621    }
622}
623impl From<crate::operation::register_job_definition::RegisterJobDefinitionError> for Error {
624    fn from(err: crate::operation::register_job_definition::RegisterJobDefinitionError) -> Self {
625        match err {
626            crate::operation::register_job_definition::RegisterJobDefinitionError::ClientException(inner) => Error::ClientException(inner),
627            crate::operation::register_job_definition::RegisterJobDefinitionError::ServerException(inner) => Error::ServerException(inner),
628            crate::operation::register_job_definition::RegisterJobDefinitionError::Unhandled(inner) => Error::Unhandled(inner),
629        }
630    }
631}
632impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::submit_job::SubmitJobError, R>> for Error
633where
634    R: Send + Sync + std::fmt::Debug + 'static,
635{
636    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::submit_job::SubmitJobError, R>) -> Self {
637        match err {
638            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
639            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
640                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
641                source: err.into(),
642            }),
643        }
644    }
645}
646impl From<crate::operation::submit_job::SubmitJobError> for Error {
647    fn from(err: crate::operation::submit_job::SubmitJobError) -> Self {
648        match err {
649            crate::operation::submit_job::SubmitJobError::ClientException(inner) => Error::ClientException(inner),
650            crate::operation::submit_job::SubmitJobError::ServerException(inner) => Error::ServerException(inner),
651            crate::operation::submit_job::SubmitJobError::Unhandled(inner) => Error::Unhandled(inner),
652        }
653    }
654}
655impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
656where
657    R: Send + Sync + std::fmt::Debug + 'static,
658{
659    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
660        match err {
661            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
662            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
663                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
664                source: err.into(),
665            }),
666        }
667    }
668}
669impl From<crate::operation::tag_resource::TagResourceError> for Error {
670    fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
671        match err {
672            crate::operation::tag_resource::TagResourceError::ClientException(inner) => Error::ClientException(inner),
673            crate::operation::tag_resource::TagResourceError::ServerException(inner) => Error::ServerException(inner),
674            crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
675        }
676    }
677}
678impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::terminate_job::TerminateJobError, R>> for Error
679where
680    R: Send + Sync + std::fmt::Debug + 'static,
681{
682    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::terminate_job::TerminateJobError, R>) -> Self {
683        match err {
684            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
685            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
686                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
687                source: err.into(),
688            }),
689        }
690    }
691}
692impl From<crate::operation::terminate_job::TerminateJobError> for Error {
693    fn from(err: crate::operation::terminate_job::TerminateJobError) -> Self {
694        match err {
695            crate::operation::terminate_job::TerminateJobError::ClientException(inner) => Error::ClientException(inner),
696            crate::operation::terminate_job::TerminateJobError::ServerException(inner) => Error::ServerException(inner),
697            crate::operation::terminate_job::TerminateJobError::Unhandled(inner) => Error::Unhandled(inner),
698        }
699    }
700}
701impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
702where
703    R: Send + Sync + std::fmt::Debug + 'static,
704{
705    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
706        match err {
707            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
708            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
709                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
710                source: err.into(),
711            }),
712        }
713    }
714}
715impl From<crate::operation::untag_resource::UntagResourceError> for Error {
716    fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
717        match err {
718            crate::operation::untag_resource::UntagResourceError::ClientException(inner) => Error::ClientException(inner),
719            crate::operation::untag_resource::UntagResourceError::ServerException(inner) => Error::ServerException(inner),
720            crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
721        }
722    }
723}
724impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_compute_environment::UpdateComputeEnvironmentError, R>>
725    for Error
726where
727    R: Send + Sync + std::fmt::Debug + 'static,
728{
729    fn from(
730        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_compute_environment::UpdateComputeEnvironmentError, R>,
731    ) -> Self {
732        match err {
733            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
734            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
735                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
736                source: err.into(),
737            }),
738        }
739    }
740}
741impl From<crate::operation::update_compute_environment::UpdateComputeEnvironmentError> for Error {
742    fn from(err: crate::operation::update_compute_environment::UpdateComputeEnvironmentError) -> Self {
743        match err {
744            crate::operation::update_compute_environment::UpdateComputeEnvironmentError::ClientException(inner) => Error::ClientException(inner),
745            crate::operation::update_compute_environment::UpdateComputeEnvironmentError::ServerException(inner) => Error::ServerException(inner),
746            crate::operation::update_compute_environment::UpdateComputeEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
747        }
748    }
749}
750impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_consumable_resource::UpdateConsumableResourceError, R>>
751    for Error
752where
753    R: Send + Sync + std::fmt::Debug + 'static,
754{
755    fn from(
756        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_consumable_resource::UpdateConsumableResourceError, R>,
757    ) -> Self {
758        match err {
759            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
760            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
761                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
762                source: err.into(),
763            }),
764        }
765    }
766}
767impl From<crate::operation::update_consumable_resource::UpdateConsumableResourceError> for Error {
768    fn from(err: crate::operation::update_consumable_resource::UpdateConsumableResourceError) -> Self {
769        match err {
770            crate::operation::update_consumable_resource::UpdateConsumableResourceError::ClientException(inner) => Error::ClientException(inner),
771            crate::operation::update_consumable_resource::UpdateConsumableResourceError::ServerException(inner) => Error::ServerException(inner),
772            crate::operation::update_consumable_resource::UpdateConsumableResourceError::Unhandled(inner) => Error::Unhandled(inner),
773        }
774    }
775}
776impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_job_queue::UpdateJobQueueError, R>> for Error
777where
778    R: Send + Sync + std::fmt::Debug + 'static,
779{
780    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_job_queue::UpdateJobQueueError, R>) -> Self {
781        match err {
782            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
783            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
784                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
785                source: err.into(),
786            }),
787        }
788    }
789}
790impl From<crate::operation::update_job_queue::UpdateJobQueueError> for Error {
791    fn from(err: crate::operation::update_job_queue::UpdateJobQueueError) -> Self {
792        match err {
793            crate::operation::update_job_queue::UpdateJobQueueError::ClientException(inner) => Error::ClientException(inner),
794            crate::operation::update_job_queue::UpdateJobQueueError::ServerException(inner) => Error::ServerException(inner),
795            crate::operation::update_job_queue::UpdateJobQueueError::Unhandled(inner) => Error::Unhandled(inner),
796        }
797    }
798}
799impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError, R>> for Error
800where
801    R: Send + Sync + std::fmt::Debug + 'static,
802{
803    fn from(
804        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError, R>,
805    ) -> Self {
806        match err {
807            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
808            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
809                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
810                source: err.into(),
811            }),
812        }
813    }
814}
815impl From<crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError> for Error {
816    fn from(err: crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError) -> Self {
817        match err {
818            crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError::ClientException(inner) => Error::ClientException(inner),
819            crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError::ServerException(inner) => Error::ServerException(inner),
820            crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError::Unhandled(inner) => Error::Unhandled(inner),
821        }
822    }
823}
824impl ::std::error::Error for Error {
825    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
826        match self {
827            Error::ClientException(inner) => inner.source(),
828            Error::ServerException(inner) => inner.source(),
829            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
830        }
831    }
832}
833impl ::aws_types::request_id::RequestId for Error {
834    fn request_id(&self) -> Option<&str> {
835        match self {
836            Self::ClientException(e) => e.request_id(),
837            Self::ServerException(e) => e.request_id(),
838            Self::Unhandled(e) => e.meta.request_id(),
839        }
840    }
841}