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