aws_sdk_pipes/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// <p>An action you attempted resulted in an exception.</p>
7    ConflictException(crate::types::error::ConflictException),
8    /// <p>This exception occurs due to unexpected causes.</p>
9    InternalException(crate::types::error::InternalException),
10    /// <p>An entity that you specified does not exist.</p>
11    NotFoundException(crate::types::error::NotFoundException),
12    /// <p>A quota has been exceeded.</p>
13    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
14    /// <p>An action was throttled.</p>
15    ThrottlingException(crate::types::error::ThrottlingException),
16    /// <p>Indicates that an error has occurred while performing a validate operation.</p>
17    ValidationException(crate::types::error::ValidationException),
18    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
19    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
20    variable wildcard pattern and check `.code()`:
21     \
22    &nbsp;&nbsp;&nbsp;`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::InternalException(inner) => inner.fmt(f),
32            Error::NotFoundException(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::InternalException(inner) => inner.meta(),
59            Self::NotFoundException(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_pipe::CreatePipeError, 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_pipe::CreatePipeError, 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_pipe::CreatePipeError> for Error {
82    fn from(err: crate::operation::create_pipe::CreatePipeError) -> Self {
83        match err {
84            crate::operation::create_pipe::CreatePipeError::ConflictException(inner) => Error::ConflictException(inner),
85            crate::operation::create_pipe::CreatePipeError::InternalException(inner) => Error::InternalException(inner),
86            crate::operation::create_pipe::CreatePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
87            crate::operation::create_pipe::CreatePipeError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
88            crate::operation::create_pipe::CreatePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
89            crate::operation::create_pipe::CreatePipeError::ValidationException(inner) => Error::ValidationException(inner),
90            crate::operation::create_pipe::CreatePipeError::Unhandled(inner) => Error::Unhandled(inner),
91        }
92    }
93}
94impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_pipe::DeletePipeError, R>> for Error
95where
96    R: Send + Sync + std::fmt::Debug + 'static,
97{
98    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_pipe::DeletePipeError, R>) -> Self {
99        match err {
100            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
101            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
102                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
103                source: err.into(),
104            }),
105        }
106    }
107}
108impl From<crate::operation::delete_pipe::DeletePipeError> for Error {
109    fn from(err: crate::operation::delete_pipe::DeletePipeError) -> Self {
110        match err {
111            crate::operation::delete_pipe::DeletePipeError::ConflictException(inner) => Error::ConflictException(inner),
112            crate::operation::delete_pipe::DeletePipeError::InternalException(inner) => Error::InternalException(inner),
113            crate::operation::delete_pipe::DeletePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
114            crate::operation::delete_pipe::DeletePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
115            crate::operation::delete_pipe::DeletePipeError::ValidationException(inner) => Error::ValidationException(inner),
116            crate::operation::delete_pipe::DeletePipeError::Unhandled(inner) => Error::Unhandled(inner),
117        }
118    }
119}
120impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_pipe::DescribePipeError, R>> for Error
121where
122    R: Send + Sync + std::fmt::Debug + 'static,
123{
124    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_pipe::DescribePipeError, R>) -> Self {
125        match err {
126            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
127            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
128                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
129                source: err.into(),
130            }),
131        }
132    }
133}
134impl From<crate::operation::describe_pipe::DescribePipeError> for Error {
135    fn from(err: crate::operation::describe_pipe::DescribePipeError) -> Self {
136        match err {
137            crate::operation::describe_pipe::DescribePipeError::InternalException(inner) => Error::InternalException(inner),
138            crate::operation::describe_pipe::DescribePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
139            crate::operation::describe_pipe::DescribePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
140            crate::operation::describe_pipe::DescribePipeError::ValidationException(inner) => Error::ValidationException(inner),
141            crate::operation::describe_pipe::DescribePipeError::Unhandled(inner) => Error::Unhandled(inner),
142        }
143    }
144}
145impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_pipes::ListPipesError, R>> for Error
146where
147    R: Send + Sync + std::fmt::Debug + 'static,
148{
149    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_pipes::ListPipesError, R>) -> Self {
150        match err {
151            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
152            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
153                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
154                source: err.into(),
155            }),
156        }
157    }
158}
159impl From<crate::operation::list_pipes::ListPipesError> for Error {
160    fn from(err: crate::operation::list_pipes::ListPipesError) -> Self {
161        match err {
162            crate::operation::list_pipes::ListPipesError::InternalException(inner) => Error::InternalException(inner),
163            crate::operation::list_pipes::ListPipesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
164            crate::operation::list_pipes::ListPipesError::ValidationException(inner) => Error::ValidationException(inner),
165            crate::operation::list_pipes::ListPipesError::Unhandled(inner) => Error::Unhandled(inner),
166        }
167    }
168}
169impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
170where
171    R: Send + Sync + std::fmt::Debug + 'static,
172{
173    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
174        match err {
175            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
176            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
177                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
178                source: err.into(),
179            }),
180        }
181    }
182}
183impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
184    fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
185        match err {
186            crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalException(inner) => Error::InternalException(inner),
187            crate::operation::list_tags_for_resource::ListTagsForResourceError::NotFoundException(inner) => Error::NotFoundException(inner),
188            crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
189            crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
190        }
191    }
192}
193impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_pipe::StartPipeError, R>> for Error
194where
195    R: Send + Sync + std::fmt::Debug + 'static,
196{
197    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_pipe::StartPipeError, R>) -> Self {
198        match err {
199            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
200            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
201                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
202                source: err.into(),
203            }),
204        }
205    }
206}
207impl From<crate::operation::start_pipe::StartPipeError> for Error {
208    fn from(err: crate::operation::start_pipe::StartPipeError) -> Self {
209        match err {
210            crate::operation::start_pipe::StartPipeError::ConflictException(inner) => Error::ConflictException(inner),
211            crate::operation::start_pipe::StartPipeError::InternalException(inner) => Error::InternalException(inner),
212            crate::operation::start_pipe::StartPipeError::NotFoundException(inner) => Error::NotFoundException(inner),
213            crate::operation::start_pipe::StartPipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
214            crate::operation::start_pipe::StartPipeError::ValidationException(inner) => Error::ValidationException(inner),
215            crate::operation::start_pipe::StartPipeError::Unhandled(inner) => Error::Unhandled(inner),
216        }
217    }
218}
219impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_pipe::StopPipeError, R>> for Error
220where
221    R: Send + Sync + std::fmt::Debug + 'static,
222{
223    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_pipe::StopPipeError, R>) -> Self {
224        match err {
225            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
226            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
227                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
228                source: err.into(),
229            }),
230        }
231    }
232}
233impl From<crate::operation::stop_pipe::StopPipeError> for Error {
234    fn from(err: crate::operation::stop_pipe::StopPipeError) -> Self {
235        match err {
236            crate::operation::stop_pipe::StopPipeError::ConflictException(inner) => Error::ConflictException(inner),
237            crate::operation::stop_pipe::StopPipeError::InternalException(inner) => Error::InternalException(inner),
238            crate::operation::stop_pipe::StopPipeError::NotFoundException(inner) => Error::NotFoundException(inner),
239            crate::operation::stop_pipe::StopPipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
240            crate::operation::stop_pipe::StopPipeError::ValidationException(inner) => Error::ValidationException(inner),
241            crate::operation::stop_pipe::StopPipeError::Unhandled(inner) => Error::Unhandled(inner),
242        }
243    }
244}
245impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
246where
247    R: Send + Sync + std::fmt::Debug + 'static,
248{
249    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
250        match err {
251            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
252            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
253                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
254                source: err.into(),
255            }),
256        }
257    }
258}
259impl From<crate::operation::tag_resource::TagResourceError> for Error {
260    fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
261        match err {
262            crate::operation::tag_resource::TagResourceError::InternalException(inner) => Error::InternalException(inner),
263            crate::operation::tag_resource::TagResourceError::NotFoundException(inner) => Error::NotFoundException(inner),
264            crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
265            crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
266        }
267    }
268}
269impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, 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::untag_resource::UntagResourceError, 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::untag_resource::UntagResourceError> for Error {
284    fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
285        match err {
286            crate::operation::untag_resource::UntagResourceError::InternalException(inner) => Error::InternalException(inner),
287            crate::operation::untag_resource::UntagResourceError::NotFoundException(inner) => Error::NotFoundException(inner),
288            crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
289            crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
290        }
291    }
292}
293impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_pipe::UpdatePipeError, R>> for Error
294where
295    R: Send + Sync + std::fmt::Debug + 'static,
296{
297    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_pipe::UpdatePipeError, R>) -> Self {
298        match err {
299            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
300            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
301                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
302                source: err.into(),
303            }),
304        }
305    }
306}
307impl From<crate::operation::update_pipe::UpdatePipeError> for Error {
308    fn from(err: crate::operation::update_pipe::UpdatePipeError) -> Self {
309        match err {
310            crate::operation::update_pipe::UpdatePipeError::ConflictException(inner) => Error::ConflictException(inner),
311            crate::operation::update_pipe::UpdatePipeError::InternalException(inner) => Error::InternalException(inner),
312            crate::operation::update_pipe::UpdatePipeError::NotFoundException(inner) => Error::NotFoundException(inner),
313            crate::operation::update_pipe::UpdatePipeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
314            crate::operation::update_pipe::UpdatePipeError::ValidationException(inner) => Error::ValidationException(inner),
315            crate::operation::update_pipe::UpdatePipeError::Unhandled(inner) => Error::Unhandled(inner),
316        }
317    }
318}
319impl ::std::error::Error for Error {
320    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
321        match self {
322            Error::ConflictException(inner) => inner.source(),
323            Error::InternalException(inner) => inner.source(),
324            Error::NotFoundException(inner) => inner.source(),
325            Error::ServiceQuotaExceededException(inner) => inner.source(),
326            Error::ThrottlingException(inner) => inner.source(),
327            Error::ValidationException(inner) => inner.source(),
328            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
329        }
330    }
331}
332impl ::aws_types::request_id::RequestId for Error {
333    fn request_id(&self) -> Option<&str> {
334        match self {
335            Self::ConflictException(e) => e.request_id(),
336            Self::InternalException(e) => e.request_id(),
337            Self::NotFoundException(e) => e.request_id(),
338            Self::ServiceQuotaExceededException(e) => e.request_id(),
339            Self::ThrottlingException(e) => e.request_id(),
340            Self::ValidationException(e) => e.request_id(),
341            Self::Unhandled(e) => e.meta.request_id(),
342        }
343    }
344}