1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 ClientException(crate::types::error::ClientException),
8 ServerException(crate::types::error::ServerException),
10 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
12 variable wildcard pattern and check `.code()`:
13 \
14 `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_job_queue::CreateJobQueueError, R>> for Error
101where
102 R: Send + Sync + std::fmt::Debug + 'static,
103{
104 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_job_queue::CreateJobQueueError, R>) -> Self {
105 match err {
106 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
107 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
108 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
109 source: err.into(),
110 }),
111 }
112 }
113}
114impl From<crate::operation::create_job_queue::CreateJobQueueError> for Error {
115 fn from(err: crate::operation::create_job_queue::CreateJobQueueError) -> Self {
116 match err {
117 crate::operation::create_job_queue::CreateJobQueueError::ClientException(inner) => Error::ClientException(inner),
118 crate::operation::create_job_queue::CreateJobQueueError::ServerException(inner) => Error::ServerException(inner),
119 crate::operation::create_job_queue::CreateJobQueueError::Unhandled(inner) => Error::Unhandled(inner),
120 }
121 }
122}
123impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_scheduling_policy::CreateSchedulingPolicyError, R>> for Error
124where
125 R: Send + Sync + std::fmt::Debug + 'static,
126{
127 fn from(
128 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_scheduling_policy::CreateSchedulingPolicyError, R>,
129 ) -> Self {
130 match err {
131 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
132 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
133 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
134 source: err.into(),
135 }),
136 }
137 }
138}
139impl From<crate::operation::create_scheduling_policy::CreateSchedulingPolicyError> for Error {
140 fn from(err: crate::operation::create_scheduling_policy::CreateSchedulingPolicyError) -> Self {
141 match err {
142 crate::operation::create_scheduling_policy::CreateSchedulingPolicyError::ClientException(inner) => Error::ClientException(inner),
143 crate::operation::create_scheduling_policy::CreateSchedulingPolicyError::ServerException(inner) => Error::ServerException(inner),
144 crate::operation::create_scheduling_policy::CreateSchedulingPolicyError::Unhandled(inner) => Error::Unhandled(inner),
145 }
146 }
147}
148impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_compute_environment::DeleteComputeEnvironmentError, R>>
149 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::delete_compute_environment::DeleteComputeEnvironmentError, 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::delete_compute_environment::DeleteComputeEnvironmentError> for Error {
166 fn from(err: crate::operation::delete_compute_environment::DeleteComputeEnvironmentError) -> Self {
167 match err {
168 crate::operation::delete_compute_environment::DeleteComputeEnvironmentError::ClientException(inner) => Error::ClientException(inner),
169 crate::operation::delete_compute_environment::DeleteComputeEnvironmentError::ServerException(inner) => Error::ServerException(inner),
170 crate::operation::delete_compute_environment::DeleteComputeEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
171 }
172 }
173}
174impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_job_queue::DeleteJobQueueError, R>> for Error
175where
176 R: Send + Sync + std::fmt::Debug + 'static,
177{
178 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_job_queue::DeleteJobQueueError, R>) -> Self {
179 match err {
180 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
181 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
182 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
183 source: err.into(),
184 }),
185 }
186 }
187}
188impl From<crate::operation::delete_job_queue::DeleteJobQueueError> for Error {
189 fn from(err: crate::operation::delete_job_queue::DeleteJobQueueError) -> Self {
190 match err {
191 crate::operation::delete_job_queue::DeleteJobQueueError::ClientException(inner) => Error::ClientException(inner),
192 crate::operation::delete_job_queue::DeleteJobQueueError::ServerException(inner) => Error::ServerException(inner),
193 crate::operation::delete_job_queue::DeleteJobQueueError::Unhandled(inner) => Error::Unhandled(inner),
194 }
195 }
196}
197impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError, R>> for Error
198where
199 R: Send + Sync + std::fmt::Debug + 'static,
200{
201 fn from(
202 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError, R>,
203 ) -> Self {
204 match err {
205 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
206 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
207 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
208 source: err.into(),
209 }),
210 }
211 }
212}
213impl From<crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError> for Error {
214 fn from(err: crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError) -> Self {
215 match err {
216 crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError::ClientException(inner) => Error::ClientException(inner),
217 crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError::ServerException(inner) => Error::ServerException(inner),
218 crate::operation::delete_scheduling_policy::DeleteSchedulingPolicyError::Unhandled(inner) => Error::Unhandled(inner),
219 }
220 }
221}
222impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::deregister_job_definition::DeregisterJobDefinitionError, R>>
223 for Error
224where
225 R: Send + Sync + std::fmt::Debug + 'static,
226{
227 fn from(
228 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::deregister_job_definition::DeregisterJobDefinitionError, R>,
229 ) -> Self {
230 match err {
231 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
232 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
233 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
234 source: err.into(),
235 }),
236 }
237 }
238}
239impl From<crate::operation::deregister_job_definition::DeregisterJobDefinitionError> for Error {
240 fn from(err: crate::operation::deregister_job_definition::DeregisterJobDefinitionError) -> Self {
241 match err {
242 crate::operation::deregister_job_definition::DeregisterJobDefinitionError::ClientException(inner) => Error::ClientException(inner),
243 crate::operation::deregister_job_definition::DeregisterJobDefinitionError::ServerException(inner) => Error::ServerException(inner),
244 crate::operation::deregister_job_definition::DeregisterJobDefinitionError::Unhandled(inner) => Error::Unhandled(inner),
245 }
246 }
247}
248impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError, R>>
249 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::describe_compute_environments::DescribeComputeEnvironmentsError, 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::describe_compute_environments::DescribeComputeEnvironmentsError> for Error {
266 fn from(err: crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError) -> Self {
267 match err {
268 crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError::ClientException(inner) => {
269 Error::ClientException(inner)
270 }
271 crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError::ServerException(inner) => {
272 Error::ServerException(inner)
273 }
274 crate::operation::describe_compute_environments::DescribeComputeEnvironmentsError::Unhandled(inner) => Error::Unhandled(inner),
275 }
276 }
277}
278impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_definitions::DescribeJobDefinitionsError, R>> for Error
279where
280 R: Send + Sync + std::fmt::Debug + 'static,
281{
282 fn from(
283 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_definitions::DescribeJobDefinitionsError, R>,
284 ) -> Self {
285 match err {
286 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
287 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
288 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
289 source: err.into(),
290 }),
291 }
292 }
293}
294impl From<crate::operation::describe_job_definitions::DescribeJobDefinitionsError> for Error {
295 fn from(err: crate::operation::describe_job_definitions::DescribeJobDefinitionsError) -> Self {
296 match err {
297 crate::operation::describe_job_definitions::DescribeJobDefinitionsError::ClientException(inner) => Error::ClientException(inner),
298 crate::operation::describe_job_definitions::DescribeJobDefinitionsError::ServerException(inner) => Error::ServerException(inner),
299 crate::operation::describe_job_definitions::DescribeJobDefinitionsError::Unhandled(inner) => Error::Unhandled(inner),
300 }
301 }
302}
303impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_queues::DescribeJobQueuesError, R>> for Error
304where
305 R: Send + Sync + std::fmt::Debug + 'static,
306{
307 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_job_queues::DescribeJobQueuesError, R>) -> 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_job_queues::DescribeJobQueuesError> for Error {
318 fn from(err: crate::operation::describe_job_queues::DescribeJobQueuesError) -> Self {
319 match err {
320 crate::operation::describe_job_queues::DescribeJobQueuesError::ClientException(inner) => Error::ClientException(inner),
321 crate::operation::describe_job_queues::DescribeJobQueuesError::ServerException(inner) => Error::ServerException(inner),
322 crate::operation::describe_job_queues::DescribeJobQueuesError::Unhandled(inner) => Error::Unhandled(inner),
323 }
324 }
325}
326impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_jobs::DescribeJobsError, R>> for Error
327where
328 R: Send + Sync + std::fmt::Debug + 'static,
329{
330 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_jobs::DescribeJobsError, R>) -> Self {
331 match err {
332 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
333 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
334 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
335 source: err.into(),
336 }),
337 }
338 }
339}
340impl From<crate::operation::describe_jobs::DescribeJobsError> for Error {
341 fn from(err: crate::operation::describe_jobs::DescribeJobsError) -> Self {
342 match err {
343 crate::operation::describe_jobs::DescribeJobsError::ClientException(inner) => Error::ClientException(inner),
344 crate::operation::describe_jobs::DescribeJobsError::ServerException(inner) => Error::ServerException(inner),
345 crate::operation::describe_jobs::DescribeJobsError::Unhandled(inner) => Error::Unhandled(inner),
346 }
347 }
348}
349impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError, R>>
350 for Error
351where
352 R: Send + Sync + std::fmt::Debug + 'static,
353{
354 fn from(
355 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError, R>,
356 ) -> Self {
357 match err {
358 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
359 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
360 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
361 source: err.into(),
362 }),
363 }
364 }
365}
366impl From<crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError> for Error {
367 fn from(err: crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError) -> Self {
368 match err {
369 crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError::ClientException(inner) => Error::ClientException(inner),
370 crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError::ServerException(inner) => Error::ServerException(inner),
371 crate::operation::describe_scheduling_policies::DescribeSchedulingPoliciesError::Unhandled(inner) => Error::Unhandled(inner),
372 }
373 }
374}
375impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError, R>> for Error
376where
377 R: Send + Sync + std::fmt::Debug + 'static,
378{
379 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError, R>) -> Self {
380 match err {
381 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
382 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
383 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
384 source: err.into(),
385 }),
386 }
387 }
388}
389impl From<crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError> for Error {
390 fn from(err: crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError) -> Self {
391 match err {
392 crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError::ClientException(inner) => Error::ClientException(inner),
393 crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError::ServerException(inner) => Error::ServerException(inner),
394 crate::operation::get_job_queue_snapshot::GetJobQueueSnapshotError::Unhandled(inner) => Error::Unhandled(inner),
395 }
396 }
397}
398impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_jobs::ListJobsError, R>> for Error
399where
400 R: Send + Sync + std::fmt::Debug + 'static,
401{
402 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_jobs::ListJobsError, R>) -> Self {
403 match err {
404 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
405 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
406 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
407 source: err.into(),
408 }),
409 }
410 }
411}
412impl From<crate::operation::list_jobs::ListJobsError> for Error {
413 fn from(err: crate::operation::list_jobs::ListJobsError) -> Self {
414 match err {
415 crate::operation::list_jobs::ListJobsError::ClientException(inner) => Error::ClientException(inner),
416 crate::operation::list_jobs::ListJobsError::ServerException(inner) => Error::ServerException(inner),
417 crate::operation::list_jobs::ListJobsError::Unhandled(inner) => Error::Unhandled(inner),
418 }
419 }
420}
421impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_scheduling_policies::ListSchedulingPoliciesError, R>> for Error
422where
423 R: Send + Sync + std::fmt::Debug + 'static,
424{
425 fn from(
426 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_scheduling_policies::ListSchedulingPoliciesError, R>,
427 ) -> Self {
428 match err {
429 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
430 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
431 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
432 source: err.into(),
433 }),
434 }
435 }
436}
437impl From<crate::operation::list_scheduling_policies::ListSchedulingPoliciesError> for Error {
438 fn from(err: crate::operation::list_scheduling_policies::ListSchedulingPoliciesError) -> Self {
439 match err {
440 crate::operation::list_scheduling_policies::ListSchedulingPoliciesError::ClientException(inner) => Error::ClientException(inner),
441 crate::operation::list_scheduling_policies::ListSchedulingPoliciesError::ServerException(inner) => Error::ServerException(inner),
442 crate::operation::list_scheduling_policies::ListSchedulingPoliciesError::Unhandled(inner) => Error::Unhandled(inner),
443 }
444 }
445}
446impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
447where
448 R: Send + Sync + std::fmt::Debug + 'static,
449{
450 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
451 match err {
452 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
453 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
454 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
455 source: err.into(),
456 }),
457 }
458 }
459}
460impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
461 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
462 match err {
463 crate::operation::list_tags_for_resource::ListTagsForResourceError::ClientException(inner) => Error::ClientException(inner),
464 crate::operation::list_tags_for_resource::ListTagsForResourceError::ServerException(inner) => Error::ServerException(inner),
465 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
466 }
467 }
468}
469impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::register_job_definition::RegisterJobDefinitionError, R>> for Error
470where
471 R: Send + Sync + std::fmt::Debug + 'static,
472{
473 fn from(
474 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::register_job_definition::RegisterJobDefinitionError, R>,
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::register_job_definition::RegisterJobDefinitionError> for Error {
486 fn from(err: crate::operation::register_job_definition::RegisterJobDefinitionError) -> Self {
487 match err {
488 crate::operation::register_job_definition::RegisterJobDefinitionError::ClientException(inner) => Error::ClientException(inner),
489 crate::operation::register_job_definition::RegisterJobDefinitionError::ServerException(inner) => Error::ServerException(inner),
490 crate::operation::register_job_definition::RegisterJobDefinitionError::Unhandled(inner) => Error::Unhandled(inner),
491 }
492 }
493}
494impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::submit_job::SubmitJobError, R>> for Error
495where
496 R: Send + Sync + std::fmt::Debug + 'static,
497{
498 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::submit_job::SubmitJobError, R>) -> Self {
499 match err {
500 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
501 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
502 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
503 source: err.into(),
504 }),
505 }
506 }
507}
508impl From<crate::operation::submit_job::SubmitJobError> for Error {
509 fn from(err: crate::operation::submit_job::SubmitJobError) -> Self {
510 match err {
511 crate::operation::submit_job::SubmitJobError::ClientException(inner) => Error::ClientException(inner),
512 crate::operation::submit_job::SubmitJobError::ServerException(inner) => Error::ServerException(inner),
513 crate::operation::submit_job::SubmitJobError::Unhandled(inner) => Error::Unhandled(inner),
514 }
515 }
516}
517impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
518where
519 R: Send + Sync + std::fmt::Debug + 'static,
520{
521 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
522 match err {
523 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
524 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
525 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
526 source: err.into(),
527 }),
528 }
529 }
530}
531impl From<crate::operation::tag_resource::TagResourceError> for Error {
532 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
533 match err {
534 crate::operation::tag_resource::TagResourceError::ClientException(inner) => Error::ClientException(inner),
535 crate::operation::tag_resource::TagResourceError::ServerException(inner) => Error::ServerException(inner),
536 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
537 }
538 }
539}
540impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::terminate_job::TerminateJobError, R>> for Error
541where
542 R: Send + Sync + std::fmt::Debug + 'static,
543{
544 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::terminate_job::TerminateJobError, R>) -> Self {
545 match err {
546 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
547 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
548 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
549 source: err.into(),
550 }),
551 }
552 }
553}
554impl From<crate::operation::terminate_job::TerminateJobError> for Error {
555 fn from(err: crate::operation::terminate_job::TerminateJobError) -> Self {
556 match err {
557 crate::operation::terminate_job::TerminateJobError::ClientException(inner) => Error::ClientException(inner),
558 crate::operation::terminate_job::TerminateJobError::ServerException(inner) => Error::ServerException(inner),
559 crate::operation::terminate_job::TerminateJobError::Unhandled(inner) => Error::Unhandled(inner),
560 }
561 }
562}
563impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
564where
565 R: Send + Sync + std::fmt::Debug + 'static,
566{
567 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
568 match err {
569 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
570 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
571 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
572 source: err.into(),
573 }),
574 }
575 }
576}
577impl From<crate::operation::untag_resource::UntagResourceError> for Error {
578 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
579 match err {
580 crate::operation::untag_resource::UntagResourceError::ClientException(inner) => Error::ClientException(inner),
581 crate::operation::untag_resource::UntagResourceError::ServerException(inner) => Error::ServerException(inner),
582 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
583 }
584 }
585}
586impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_compute_environment::UpdateComputeEnvironmentError, R>>
587 for Error
588where
589 R: Send + Sync + std::fmt::Debug + 'static,
590{
591 fn from(
592 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_compute_environment::UpdateComputeEnvironmentError, R>,
593 ) -> Self {
594 match err {
595 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
596 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
597 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
598 source: err.into(),
599 }),
600 }
601 }
602}
603impl From<crate::operation::update_compute_environment::UpdateComputeEnvironmentError> for Error {
604 fn from(err: crate::operation::update_compute_environment::UpdateComputeEnvironmentError) -> Self {
605 match err {
606 crate::operation::update_compute_environment::UpdateComputeEnvironmentError::ClientException(inner) => Error::ClientException(inner),
607 crate::operation::update_compute_environment::UpdateComputeEnvironmentError::ServerException(inner) => Error::ServerException(inner),
608 crate::operation::update_compute_environment::UpdateComputeEnvironmentError::Unhandled(inner) => Error::Unhandled(inner),
609 }
610 }
611}
612impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_job_queue::UpdateJobQueueError, R>> for Error
613where
614 R: Send + Sync + std::fmt::Debug + 'static,
615{
616 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_job_queue::UpdateJobQueueError, R>) -> Self {
617 match err {
618 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
619 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
620 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
621 source: err.into(),
622 }),
623 }
624 }
625}
626impl From<crate::operation::update_job_queue::UpdateJobQueueError> for Error {
627 fn from(err: crate::operation::update_job_queue::UpdateJobQueueError) -> Self {
628 match err {
629 crate::operation::update_job_queue::UpdateJobQueueError::ClientException(inner) => Error::ClientException(inner),
630 crate::operation::update_job_queue::UpdateJobQueueError::ServerException(inner) => Error::ServerException(inner),
631 crate::operation::update_job_queue::UpdateJobQueueError::Unhandled(inner) => Error::Unhandled(inner),
632 }
633 }
634}
635impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError, R>> for Error
636where
637 R: Send + Sync + std::fmt::Debug + 'static,
638{
639 fn from(
640 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError, R>,
641 ) -> Self {
642 match err {
643 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
644 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
645 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
646 source: err.into(),
647 }),
648 }
649 }
650}
651impl From<crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError> for Error {
652 fn from(err: crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError) -> Self {
653 match err {
654 crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError::ClientException(inner) => Error::ClientException(inner),
655 crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError::ServerException(inner) => Error::ServerException(inner),
656 crate::operation::update_scheduling_policy::UpdateSchedulingPolicyError::Unhandled(inner) => Error::Unhandled(inner),
657 }
658 }
659}
660impl ::std::error::Error for Error {
661 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
662 match self {
663 Error::ClientException(inner) => inner.source(),
664 Error::ServerException(inner) => inner.source(),
665 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
666 }
667 }
668}
669impl ::aws_types::request_id::RequestId for Error {
670 fn request_id(&self) -> Option<&str> {
671 match self {
672 Self::ClientException(e) => e.request_id(),
673 Self::ServerException(e) => e.request_id(),
674 Self::Unhandled(e) => e.meta.request_id(),
675 }
676 }
677}