1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 ConflictException(crate::types::error::ConflictException),
8 InternalServerException(crate::types::error::InternalServerException),
10 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
12 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
14 ThrottlingException(crate::types::error::ThrottlingException),
16 ValidationException(crate::types::error::ValidationException),
18 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
20 variable wildcard pattern and check `.code()`:
21 \
22 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
23 \
24 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
25 Unhandled(crate::error::sealed_unhandled::Unhandled),
26}
27impl ::std::fmt::Display for Error {
28 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29 match self {
30 Error::ConflictException(inner) => inner.fmt(f),
31 Error::InternalServerException(inner) => inner.fmt(f),
32 Error::ResourceNotFoundException(inner) => inner.fmt(f),
33 Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
34 Error::ThrottlingException(inner) => inner.fmt(f),
35 Error::ValidationException(inner) => inner.fmt(f),
36 Error::Unhandled(_) => {
37 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
38 write!(f, "unhandled error ({code})")
39 } else {
40 f.write_str("unhandled error")
41 }
42 }
43 }
44 }
45}
46impl From<::aws_smithy_types::error::operation::BuildError> for Error {
47 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
48 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
49 source: value.into(),
50 meta: ::std::default::Default::default(),
51 })
52 }
53}
54impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
55 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
56 match self {
57 Self::ConflictException(inner) => inner.meta(),
58 Self::InternalServerException(inner) => inner.meta(),
59 Self::ResourceNotFoundException(inner) => inner.meta(),
60 Self::ServiceQuotaExceededException(inner) => inner.meta(),
61 Self::ThrottlingException(inner) => inner.meta(),
62 Self::ValidationException(inner) => inner.meta(),
63 Self::Unhandled(inner) => &inner.meta,
64 }
65 }
66}
67impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_access_point::CreateAccessPointError, R>> for Error
68where
69 R: Send + Sync + std::fmt::Debug + 'static,
70{
71 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_access_point::CreateAccessPointError, R>) -> Self {
72 match err {
73 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
74 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
75 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
76 source: err.into(),
77 }),
78 }
79 }
80}
81impl From<crate::operation::create_access_point::CreateAccessPointError> for Error {
82 fn from(err: crate::operation::create_access_point::CreateAccessPointError) -> Self {
83 match err {
84 crate::operation::create_access_point::CreateAccessPointError::ConflictException(inner) => Error::ConflictException(inner),
85 crate::operation::create_access_point::CreateAccessPointError::InternalServerException(inner) => Error::InternalServerException(inner),
86 crate::operation::create_access_point::CreateAccessPointError::ResourceNotFoundException(inner) => {
87 Error::ResourceNotFoundException(inner)
88 }
89 crate::operation::create_access_point::CreateAccessPointError::ServiceQuotaExceededException(inner) => {
90 Error::ServiceQuotaExceededException(inner)
91 }
92 crate::operation::create_access_point::CreateAccessPointError::ValidationException(inner) => Error::ValidationException(inner),
93 crate::operation::create_access_point::CreateAccessPointError::ThrottlingException(inner) => Error::ThrottlingException(inner),
94 crate::operation::create_access_point::CreateAccessPointError::Unhandled(inner) => Error::Unhandled(inner),
95 }
96 }
97}
98impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_file_system::CreateFileSystemError, R>> for Error
99where
100 R: Send + Sync + std::fmt::Debug + 'static,
101{
102 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_file_system::CreateFileSystemError, R>) -> Self {
103 match err {
104 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
105 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
106 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
107 source: err.into(),
108 }),
109 }
110 }
111}
112impl From<crate::operation::create_file_system::CreateFileSystemError> for Error {
113 fn from(err: crate::operation::create_file_system::CreateFileSystemError) -> Self {
114 match err {
115 crate::operation::create_file_system::CreateFileSystemError::ConflictException(inner) => Error::ConflictException(inner),
116 crate::operation::create_file_system::CreateFileSystemError::InternalServerException(inner) => Error::InternalServerException(inner),
117 crate::operation::create_file_system::CreateFileSystemError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
118 crate::operation::create_file_system::CreateFileSystemError::ServiceQuotaExceededException(inner) => {
119 Error::ServiceQuotaExceededException(inner)
120 }
121 crate::operation::create_file_system::CreateFileSystemError::ValidationException(inner) => Error::ValidationException(inner),
122 crate::operation::create_file_system::CreateFileSystemError::ThrottlingException(inner) => Error::ThrottlingException(inner),
123 crate::operation::create_file_system::CreateFileSystemError::Unhandled(inner) => Error::Unhandled(inner),
124 }
125 }
126}
127impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_mount_target::CreateMountTargetError, R>> for Error
128where
129 R: Send + Sync + std::fmt::Debug + 'static,
130{
131 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_mount_target::CreateMountTargetError, R>) -> Self {
132 match err {
133 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
134 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
135 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
136 source: err.into(),
137 }),
138 }
139 }
140}
141impl From<crate::operation::create_mount_target::CreateMountTargetError> for Error {
142 fn from(err: crate::operation::create_mount_target::CreateMountTargetError) -> Self {
143 match err {
144 crate::operation::create_mount_target::CreateMountTargetError::ConflictException(inner) => Error::ConflictException(inner),
145 crate::operation::create_mount_target::CreateMountTargetError::InternalServerException(inner) => Error::InternalServerException(inner),
146 crate::operation::create_mount_target::CreateMountTargetError::ResourceNotFoundException(inner) => {
147 Error::ResourceNotFoundException(inner)
148 }
149 crate::operation::create_mount_target::CreateMountTargetError::ServiceQuotaExceededException(inner) => {
150 Error::ServiceQuotaExceededException(inner)
151 }
152 crate::operation::create_mount_target::CreateMountTargetError::ValidationException(inner) => Error::ValidationException(inner),
153 crate::operation::create_mount_target::CreateMountTargetError::ThrottlingException(inner) => Error::ThrottlingException(inner),
154 crate::operation::create_mount_target::CreateMountTargetError::Unhandled(inner) => Error::Unhandled(inner),
155 }
156 }
157}
158impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_access_point::DeleteAccessPointError, R>> for Error
159where
160 R: Send + Sync + std::fmt::Debug + 'static,
161{
162 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_access_point::DeleteAccessPointError, R>) -> Self {
163 match err {
164 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
165 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
166 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
167 source: err.into(),
168 }),
169 }
170 }
171}
172impl From<crate::operation::delete_access_point::DeleteAccessPointError> for Error {
173 fn from(err: crate::operation::delete_access_point::DeleteAccessPointError) -> Self {
174 match err {
175 crate::operation::delete_access_point::DeleteAccessPointError::ConflictException(inner) => Error::ConflictException(inner),
176 crate::operation::delete_access_point::DeleteAccessPointError::InternalServerException(inner) => Error::InternalServerException(inner),
177 crate::operation::delete_access_point::DeleteAccessPointError::ResourceNotFoundException(inner) => {
178 Error::ResourceNotFoundException(inner)
179 }
180 crate::operation::delete_access_point::DeleteAccessPointError::ValidationException(inner) => Error::ValidationException(inner),
181 crate::operation::delete_access_point::DeleteAccessPointError::ThrottlingException(inner) => Error::ThrottlingException(inner),
182 crate::operation::delete_access_point::DeleteAccessPointError::Unhandled(inner) => Error::Unhandled(inner),
183 }
184 }
185}
186impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_file_system::DeleteFileSystemError, R>> for Error
187where
188 R: Send + Sync + std::fmt::Debug + 'static,
189{
190 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_file_system::DeleteFileSystemError, R>) -> Self {
191 match err {
192 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
193 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
194 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
195 source: err.into(),
196 }),
197 }
198 }
199}
200impl From<crate::operation::delete_file_system::DeleteFileSystemError> for Error {
201 fn from(err: crate::operation::delete_file_system::DeleteFileSystemError) -> Self {
202 match err {
203 crate::operation::delete_file_system::DeleteFileSystemError::ConflictException(inner) => Error::ConflictException(inner),
204 crate::operation::delete_file_system::DeleteFileSystemError::InternalServerException(inner) => Error::InternalServerException(inner),
205 crate::operation::delete_file_system::DeleteFileSystemError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
206 crate::operation::delete_file_system::DeleteFileSystemError::ValidationException(inner) => Error::ValidationException(inner),
207 crate::operation::delete_file_system::DeleteFileSystemError::ThrottlingException(inner) => Error::ThrottlingException(inner),
208 crate::operation::delete_file_system::DeleteFileSystemError::Unhandled(inner) => Error::Unhandled(inner),
209 }
210 }
211}
212impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError, R>>
213 for Error
214where
215 R: Send + Sync + std::fmt::Debug + 'static,
216{
217 fn from(
218 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError, R>,
219 ) -> 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_file_system_policy::DeleteFileSystemPolicyError> for Error {
230 fn from(err: crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError) -> Self {
231 match err {
232 crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError::InternalServerException(inner) => {
233 Error::InternalServerException(inner)
234 }
235 crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError::ResourceNotFoundException(inner) => {
236 Error::ResourceNotFoundException(inner)
237 }
238 crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError::ValidationException(inner) => Error::ValidationException(inner),
239 crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError::ThrottlingException(inner) => Error::ThrottlingException(inner),
240 crate::operation::delete_file_system_policy::DeleteFileSystemPolicyError::Unhandled(inner) => Error::Unhandled(inner),
241 }
242 }
243}
244impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_mount_target::DeleteMountTargetError, R>> for Error
245where
246 R: Send + Sync + std::fmt::Debug + 'static,
247{
248 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_mount_target::DeleteMountTargetError, R>) -> Self {
249 match err {
250 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
251 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
252 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
253 source: err.into(),
254 }),
255 }
256 }
257}
258impl From<crate::operation::delete_mount_target::DeleteMountTargetError> for Error {
259 fn from(err: crate::operation::delete_mount_target::DeleteMountTargetError) -> Self {
260 match err {
261 crate::operation::delete_mount_target::DeleteMountTargetError::ConflictException(inner) => Error::ConflictException(inner),
262 crate::operation::delete_mount_target::DeleteMountTargetError::InternalServerException(inner) => Error::InternalServerException(inner),
263 crate::operation::delete_mount_target::DeleteMountTargetError::ResourceNotFoundException(inner) => {
264 Error::ResourceNotFoundException(inner)
265 }
266 crate::operation::delete_mount_target::DeleteMountTargetError::ValidationException(inner) => Error::ValidationException(inner),
267 crate::operation::delete_mount_target::DeleteMountTargetError::ThrottlingException(inner) => Error::ThrottlingException(inner),
268 crate::operation::delete_mount_target::DeleteMountTargetError::Unhandled(inner) => Error::Unhandled(inner),
269 }
270 }
271}
272impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_access_point::GetAccessPointError, R>> for Error
273where
274 R: Send + Sync + std::fmt::Debug + 'static,
275{
276 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_access_point::GetAccessPointError, R>) -> Self {
277 match err {
278 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
279 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
280 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
281 source: err.into(),
282 }),
283 }
284 }
285}
286impl From<crate::operation::get_access_point::GetAccessPointError> for Error {
287 fn from(err: crate::operation::get_access_point::GetAccessPointError) -> Self {
288 match err {
289 crate::operation::get_access_point::GetAccessPointError::InternalServerException(inner) => Error::InternalServerException(inner),
290 crate::operation::get_access_point::GetAccessPointError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
291 crate::operation::get_access_point::GetAccessPointError::ValidationException(inner) => Error::ValidationException(inner),
292 crate::operation::get_access_point::GetAccessPointError::ThrottlingException(inner) => Error::ThrottlingException(inner),
293 crate::operation::get_access_point::GetAccessPointError::Unhandled(inner) => Error::Unhandled(inner),
294 }
295 }
296}
297impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_file_system::GetFileSystemError, R>> for Error
298where
299 R: Send + Sync + std::fmt::Debug + 'static,
300{
301 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_file_system::GetFileSystemError, R>) -> Self {
302 match err {
303 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
304 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
305 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
306 source: err.into(),
307 }),
308 }
309 }
310}
311impl From<crate::operation::get_file_system::GetFileSystemError> for Error {
312 fn from(err: crate::operation::get_file_system::GetFileSystemError) -> Self {
313 match err {
314 crate::operation::get_file_system::GetFileSystemError::InternalServerException(inner) => Error::InternalServerException(inner),
315 crate::operation::get_file_system::GetFileSystemError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
316 crate::operation::get_file_system::GetFileSystemError::ValidationException(inner) => Error::ValidationException(inner),
317 crate::operation::get_file_system::GetFileSystemError::ThrottlingException(inner) => Error::ThrottlingException(inner),
318 crate::operation::get_file_system::GetFileSystemError::Unhandled(inner) => Error::Unhandled(inner),
319 }
320 }
321}
322impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_file_system_policy::GetFileSystemPolicyError, R>> for Error
323where
324 R: Send + Sync + std::fmt::Debug + 'static,
325{
326 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_file_system_policy::GetFileSystemPolicyError, R>) -> Self {
327 match err {
328 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
329 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
330 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
331 source: err.into(),
332 }),
333 }
334 }
335}
336impl From<crate::operation::get_file_system_policy::GetFileSystemPolicyError> for Error {
337 fn from(err: crate::operation::get_file_system_policy::GetFileSystemPolicyError) -> Self {
338 match err {
339 crate::operation::get_file_system_policy::GetFileSystemPolicyError::InternalServerException(inner) => {
340 Error::InternalServerException(inner)
341 }
342 crate::operation::get_file_system_policy::GetFileSystemPolicyError::ResourceNotFoundException(inner) => {
343 Error::ResourceNotFoundException(inner)
344 }
345 crate::operation::get_file_system_policy::GetFileSystemPolicyError::ValidationException(inner) => Error::ValidationException(inner),
346 crate::operation::get_file_system_policy::GetFileSystemPolicyError::ThrottlingException(inner) => Error::ThrottlingException(inner),
347 crate::operation::get_file_system_policy::GetFileSystemPolicyError::Unhandled(inner) => Error::Unhandled(inner),
348 }
349 }
350}
351impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_mount_target::GetMountTargetError, R>> for Error
352where
353 R: Send + Sync + std::fmt::Debug + 'static,
354{
355 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_mount_target::GetMountTargetError, R>) -> Self {
356 match err {
357 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
358 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
359 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
360 source: err.into(),
361 }),
362 }
363 }
364}
365impl From<crate::operation::get_mount_target::GetMountTargetError> for Error {
366 fn from(err: crate::operation::get_mount_target::GetMountTargetError) -> Self {
367 match err {
368 crate::operation::get_mount_target::GetMountTargetError::InternalServerException(inner) => Error::InternalServerException(inner),
369 crate::operation::get_mount_target::GetMountTargetError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
370 crate::operation::get_mount_target::GetMountTargetError::ValidationException(inner) => Error::ValidationException(inner),
371 crate::operation::get_mount_target::GetMountTargetError::ThrottlingException(inner) => Error::ThrottlingException(inner),
372 crate::operation::get_mount_target::GetMountTargetError::Unhandled(inner) => Error::Unhandled(inner),
373 }
374 }
375}
376impl<R>
377 From<
378 ::aws_smithy_runtime_api::client::result::SdkError<
379 crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError,
380 R,
381 >,
382 > for Error
383where
384 R: Send + Sync + std::fmt::Debug + 'static,
385{
386 fn from(
387 err: ::aws_smithy_runtime_api::client::result::SdkError<
388 crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError,
389 R,
390 >,
391 ) -> Self {
392 match err {
393 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
394 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
395 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
396 source: err.into(),
397 }),
398 }
399 }
400}
401impl From<crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError> for Error {
402 fn from(err: crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError) -> Self {
403 match err {
404 crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError::InternalServerException(inner) => {
405 Error::InternalServerException(inner)
406 }
407 crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError::ResourceNotFoundException(inner) => {
408 Error::ResourceNotFoundException(inner)
409 }
410 crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError::ValidationException(inner) => {
411 Error::ValidationException(inner)
412 }
413 crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError::ThrottlingException(inner) => {
414 Error::ThrottlingException(inner)
415 }
416 crate::operation::get_synchronization_configuration::GetSynchronizationConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
417 }
418 }
419}
420impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_access_points::ListAccessPointsError, R>> for Error
421where
422 R: Send + Sync + std::fmt::Debug + 'static,
423{
424 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_access_points::ListAccessPointsError, R>) -> Self {
425 match err {
426 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
427 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
428 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
429 source: err.into(),
430 }),
431 }
432 }
433}
434impl From<crate::operation::list_access_points::ListAccessPointsError> for Error {
435 fn from(err: crate::operation::list_access_points::ListAccessPointsError) -> Self {
436 match err {
437 crate::operation::list_access_points::ListAccessPointsError::InternalServerException(inner) => Error::InternalServerException(inner),
438 crate::operation::list_access_points::ListAccessPointsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
439 crate::operation::list_access_points::ListAccessPointsError::ValidationException(inner) => Error::ValidationException(inner),
440 crate::operation::list_access_points::ListAccessPointsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
441 crate::operation::list_access_points::ListAccessPointsError::Unhandled(inner) => Error::Unhandled(inner),
442 }
443 }
444}
445impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_file_systems::ListFileSystemsError, R>> for Error
446where
447 R: Send + Sync + std::fmt::Debug + 'static,
448{
449 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_file_systems::ListFileSystemsError, R>) -> Self {
450 match err {
451 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
452 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
453 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
454 source: err.into(),
455 }),
456 }
457 }
458}
459impl From<crate::operation::list_file_systems::ListFileSystemsError> for Error {
460 fn from(err: crate::operation::list_file_systems::ListFileSystemsError) -> Self {
461 match err {
462 crate::operation::list_file_systems::ListFileSystemsError::InternalServerException(inner) => Error::InternalServerException(inner),
463 crate::operation::list_file_systems::ListFileSystemsError::ValidationException(inner) => Error::ValidationException(inner),
464 crate::operation::list_file_systems::ListFileSystemsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
465 crate::operation::list_file_systems::ListFileSystemsError::Unhandled(inner) => Error::Unhandled(inner),
466 }
467 }
468}
469impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_mount_targets::ListMountTargetsError, R>> for Error
470where
471 R: Send + Sync + std::fmt::Debug + 'static,
472{
473 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_mount_targets::ListMountTargetsError, R>) -> Self {
474 match err {
475 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
476 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
477 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
478 source: err.into(),
479 }),
480 }
481 }
482}
483impl From<crate::operation::list_mount_targets::ListMountTargetsError> for Error {
484 fn from(err: crate::operation::list_mount_targets::ListMountTargetsError) -> Self {
485 match err {
486 crate::operation::list_mount_targets::ListMountTargetsError::InternalServerException(inner) => Error::InternalServerException(inner),
487 crate::operation::list_mount_targets::ListMountTargetsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
488 crate::operation::list_mount_targets::ListMountTargetsError::ValidationException(inner) => Error::ValidationException(inner),
489 crate::operation::list_mount_targets::ListMountTargetsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
490 crate::operation::list_mount_targets::ListMountTargetsError::Unhandled(inner) => Error::Unhandled(inner),
491 }
492 }
493}
494impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, 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::list_tags_for_resource::ListTagsForResourceError, 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::list_tags_for_resource::ListTagsForResourceError> for Error {
509 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
510 match err {
511 crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => {
512 Error::InternalServerException(inner)
513 }
514 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
515 Error::ResourceNotFoundException(inner)
516 }
517 crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
518 crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
519 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
520 }
521 }
522}
523impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_file_system_policy::PutFileSystemPolicyError, R>> for Error
524where
525 R: Send + Sync + std::fmt::Debug + 'static,
526{
527 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_file_system_policy::PutFileSystemPolicyError, R>) -> Self {
528 match err {
529 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
530 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
531 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
532 source: err.into(),
533 }),
534 }
535 }
536}
537impl From<crate::operation::put_file_system_policy::PutFileSystemPolicyError> for Error {
538 fn from(err: crate::operation::put_file_system_policy::PutFileSystemPolicyError) -> Self {
539 match err {
540 crate::operation::put_file_system_policy::PutFileSystemPolicyError::InternalServerException(inner) => {
541 Error::InternalServerException(inner)
542 }
543 crate::operation::put_file_system_policy::PutFileSystemPolicyError::ResourceNotFoundException(inner) => {
544 Error::ResourceNotFoundException(inner)
545 }
546 crate::operation::put_file_system_policy::PutFileSystemPolicyError::ValidationException(inner) => Error::ValidationException(inner),
547 crate::operation::put_file_system_policy::PutFileSystemPolicyError::ThrottlingException(inner) => Error::ThrottlingException(inner),
548 crate::operation::put_file_system_policy::PutFileSystemPolicyError::Unhandled(inner) => Error::Unhandled(inner),
549 }
550 }
551}
552impl<R>
553 From<
554 ::aws_smithy_runtime_api::client::result::SdkError<
555 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError,
556 R,
557 >,
558 > for Error
559where
560 R: Send + Sync + std::fmt::Debug + 'static,
561{
562 fn from(
563 err: ::aws_smithy_runtime_api::client::result::SdkError<
564 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError,
565 R,
566 >,
567 ) -> 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::put_synchronization_configuration::PutSynchronizationConfigurationError> for Error {
578 fn from(err: crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError) -> Self {
579 match err {
580 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError::ConflictException(inner) => {
581 Error::ConflictException(inner)
582 }
583 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError::InternalServerException(inner) => {
584 Error::InternalServerException(inner)
585 }
586 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError::ResourceNotFoundException(inner) => {
587 Error::ResourceNotFoundException(inner)
588 }
589 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError::ValidationException(inner) => {
590 Error::ValidationException(inner)
591 }
592 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError::ThrottlingException(inner) => {
593 Error::ThrottlingException(inner)
594 }
595 crate::operation::put_synchronization_configuration::PutSynchronizationConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
596 }
597 }
598}
599impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
600where
601 R: Send + Sync + std::fmt::Debug + 'static,
602{
603 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
604 match err {
605 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
606 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
607 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
608 source: err.into(),
609 }),
610 }
611 }
612}
613impl From<crate::operation::tag_resource::TagResourceError> for Error {
614 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
615 match err {
616 crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
617 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
618 crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
619 crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
620 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
621 }
622 }
623}
624impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
625where
626 R: Send + Sync + std::fmt::Debug + 'static,
627{
628 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
629 match err {
630 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
631 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
632 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
633 source: err.into(),
634 }),
635 }
636 }
637}
638impl From<crate::operation::untag_resource::UntagResourceError> for Error {
639 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
640 match err {
641 crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
642 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
643 crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
644 crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
645 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
646 }
647 }
648}
649impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_mount_target::UpdateMountTargetError, R>> for Error
650where
651 R: Send + Sync + std::fmt::Debug + 'static,
652{
653 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_mount_target::UpdateMountTargetError, R>) -> Self {
654 match err {
655 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
656 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
657 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
658 source: err.into(),
659 }),
660 }
661 }
662}
663impl From<crate::operation::update_mount_target::UpdateMountTargetError> for Error {
664 fn from(err: crate::operation::update_mount_target::UpdateMountTargetError) -> Self {
665 match err {
666 crate::operation::update_mount_target::UpdateMountTargetError::InternalServerException(inner) => Error::InternalServerException(inner),
667 crate::operation::update_mount_target::UpdateMountTargetError::ResourceNotFoundException(inner) => {
668 Error::ResourceNotFoundException(inner)
669 }
670 crate::operation::update_mount_target::UpdateMountTargetError::ValidationException(inner) => Error::ValidationException(inner),
671 crate::operation::update_mount_target::UpdateMountTargetError::ThrottlingException(inner) => Error::ThrottlingException(inner),
672 crate::operation::update_mount_target::UpdateMountTargetError::Unhandled(inner) => Error::Unhandled(inner),
673 }
674 }
675}
676impl ::std::error::Error for Error {
677 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
678 match self {
679 Error::ConflictException(inner) => inner.source(),
680 Error::InternalServerException(inner) => inner.source(),
681 Error::ResourceNotFoundException(inner) => inner.source(),
682 Error::ServiceQuotaExceededException(inner) => inner.source(),
683 Error::ThrottlingException(inner) => inner.source(),
684 Error::ValidationException(inner) => inner.source(),
685 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
686 }
687 }
688}
689impl ::aws_types::request_id::RequestId for Error {
690 fn request_id(&self) -> Option<&str> {
691 match self {
692 Self::ConflictException(e) => e.request_id(),
693 Self::InternalServerException(e) => e.request_id(),
694 Self::ResourceNotFoundException(e) => e.request_id(),
695 Self::ServiceQuotaExceededException(e) => e.request_id(),
696 Self::ThrottlingException(e) => e.request_id(),
697 Self::ValidationException(e) => e.request_id(),
698 Self::Unhandled(e) => e.meta.request_id(),
699 }
700 }
701}