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_schedule::CreateScheduleError, 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_schedule::CreateScheduleError, 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_schedule::CreateScheduleError> for Error {
82 fn from(err: crate::operation::create_schedule::CreateScheduleError) -> Self {
83 match err {
84 crate::operation::create_schedule::CreateScheduleError::ConflictException(inner) => Error::ConflictException(inner),
85 crate::operation::create_schedule::CreateScheduleError::InternalServerException(inner) => Error::InternalServerException(inner),
86 crate::operation::create_schedule::CreateScheduleError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
87 crate::operation::create_schedule::CreateScheduleError::ServiceQuotaExceededException(inner) => {
88 Error::ServiceQuotaExceededException(inner)
89 }
90 crate::operation::create_schedule::CreateScheduleError::ThrottlingException(inner) => Error::ThrottlingException(inner),
91 crate::operation::create_schedule::CreateScheduleError::ValidationException(inner) => Error::ValidationException(inner),
92 crate::operation::create_schedule::CreateScheduleError::Unhandled(inner) => Error::Unhandled(inner),
93 }
94 }
95}
96impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_schedule_group::CreateScheduleGroupError, R>> for Error
97where
98 R: Send + Sync + std::fmt::Debug + 'static,
99{
100 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_schedule_group::CreateScheduleGroupError, R>) -> Self {
101 match err {
102 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
103 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
104 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
105 source: err.into(),
106 }),
107 }
108 }
109}
110impl From<crate::operation::create_schedule_group::CreateScheduleGroupError> for Error {
111 fn from(err: crate::operation::create_schedule_group::CreateScheduleGroupError) -> Self {
112 match err {
113 crate::operation::create_schedule_group::CreateScheduleGroupError::ConflictException(inner) => Error::ConflictException(inner),
114 crate::operation::create_schedule_group::CreateScheduleGroupError::InternalServerException(inner) => {
115 Error::InternalServerException(inner)
116 }
117 crate::operation::create_schedule_group::CreateScheduleGroupError::ServiceQuotaExceededException(inner) => {
118 Error::ServiceQuotaExceededException(inner)
119 }
120 crate::operation::create_schedule_group::CreateScheduleGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner),
121 crate::operation::create_schedule_group::CreateScheduleGroupError::ValidationException(inner) => Error::ValidationException(inner),
122 crate::operation::create_schedule_group::CreateScheduleGroupError::Unhandled(inner) => Error::Unhandled(inner),
123 }
124 }
125}
126impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_schedule::DeleteScheduleError, R>> for Error
127where
128 R: Send + Sync + std::fmt::Debug + 'static,
129{
130 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_schedule::DeleteScheduleError, R>) -> Self {
131 match err {
132 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
133 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
134 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
135 source: err.into(),
136 }),
137 }
138 }
139}
140impl From<crate::operation::delete_schedule::DeleteScheduleError> for Error {
141 fn from(err: crate::operation::delete_schedule::DeleteScheduleError) -> Self {
142 match err {
143 crate::operation::delete_schedule::DeleteScheduleError::ConflictException(inner) => Error::ConflictException(inner),
144 crate::operation::delete_schedule::DeleteScheduleError::InternalServerException(inner) => Error::InternalServerException(inner),
145 crate::operation::delete_schedule::DeleteScheduleError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
146 crate::operation::delete_schedule::DeleteScheduleError::ThrottlingException(inner) => Error::ThrottlingException(inner),
147 crate::operation::delete_schedule::DeleteScheduleError::ValidationException(inner) => Error::ValidationException(inner),
148 crate::operation::delete_schedule::DeleteScheduleError::Unhandled(inner) => Error::Unhandled(inner),
149 }
150 }
151}
152impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_schedule_group::DeleteScheduleGroupError, R>> for Error
153where
154 R: Send + Sync + std::fmt::Debug + 'static,
155{
156 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_schedule_group::DeleteScheduleGroupError, R>) -> Self {
157 match err {
158 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
159 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
160 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
161 source: err.into(),
162 }),
163 }
164 }
165}
166impl From<crate::operation::delete_schedule_group::DeleteScheduleGroupError> for Error {
167 fn from(err: crate::operation::delete_schedule_group::DeleteScheduleGroupError) -> Self {
168 match err {
169 crate::operation::delete_schedule_group::DeleteScheduleGroupError::ConflictException(inner) => Error::ConflictException(inner),
170 crate::operation::delete_schedule_group::DeleteScheduleGroupError::InternalServerException(inner) => {
171 Error::InternalServerException(inner)
172 }
173 crate::operation::delete_schedule_group::DeleteScheduleGroupError::ResourceNotFoundException(inner) => {
174 Error::ResourceNotFoundException(inner)
175 }
176 crate::operation::delete_schedule_group::DeleteScheduleGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner),
177 crate::operation::delete_schedule_group::DeleteScheduleGroupError::ValidationException(inner) => Error::ValidationException(inner),
178 crate::operation::delete_schedule_group::DeleteScheduleGroupError::Unhandled(inner) => Error::Unhandled(inner),
179 }
180 }
181}
182impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_schedule::GetScheduleError, R>> for Error
183where
184 R: Send + Sync + std::fmt::Debug + 'static,
185{
186 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_schedule::GetScheduleError, R>) -> Self {
187 match err {
188 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
189 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
190 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
191 source: err.into(),
192 }),
193 }
194 }
195}
196impl From<crate::operation::get_schedule::GetScheduleError> for Error {
197 fn from(err: crate::operation::get_schedule::GetScheduleError) -> Self {
198 match err {
199 crate::operation::get_schedule::GetScheduleError::InternalServerException(inner) => Error::InternalServerException(inner),
200 crate::operation::get_schedule::GetScheduleError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
201 crate::operation::get_schedule::GetScheduleError::ThrottlingException(inner) => Error::ThrottlingException(inner),
202 crate::operation::get_schedule::GetScheduleError::ValidationException(inner) => Error::ValidationException(inner),
203 crate::operation::get_schedule::GetScheduleError::Unhandled(inner) => Error::Unhandled(inner),
204 }
205 }
206}
207impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_schedule_group::GetScheduleGroupError, R>> for Error
208where
209 R: Send + Sync + std::fmt::Debug + 'static,
210{
211 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_schedule_group::GetScheduleGroupError, R>) -> Self {
212 match err {
213 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
214 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
215 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
216 source: err.into(),
217 }),
218 }
219 }
220}
221impl From<crate::operation::get_schedule_group::GetScheduleGroupError> for Error {
222 fn from(err: crate::operation::get_schedule_group::GetScheduleGroupError) -> Self {
223 match err {
224 crate::operation::get_schedule_group::GetScheduleGroupError::InternalServerException(inner) => Error::InternalServerException(inner),
225 crate::operation::get_schedule_group::GetScheduleGroupError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
226 crate::operation::get_schedule_group::GetScheduleGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner),
227 crate::operation::get_schedule_group::GetScheduleGroupError::ValidationException(inner) => Error::ValidationException(inner),
228 crate::operation::get_schedule_group::GetScheduleGroupError::Unhandled(inner) => Error::Unhandled(inner),
229 }
230 }
231}
232impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_schedule_groups::ListScheduleGroupsError, R>> for Error
233where
234 R: Send + Sync + std::fmt::Debug + 'static,
235{
236 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_schedule_groups::ListScheduleGroupsError, R>) -> Self {
237 match err {
238 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
239 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
240 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
241 source: err.into(),
242 }),
243 }
244 }
245}
246impl From<crate::operation::list_schedule_groups::ListScheduleGroupsError> for Error {
247 fn from(err: crate::operation::list_schedule_groups::ListScheduleGroupsError) -> Self {
248 match err {
249 crate::operation::list_schedule_groups::ListScheduleGroupsError::InternalServerException(inner) => Error::InternalServerException(inner),
250 crate::operation::list_schedule_groups::ListScheduleGroupsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
251 crate::operation::list_schedule_groups::ListScheduleGroupsError::ValidationException(inner) => Error::ValidationException(inner),
252 crate::operation::list_schedule_groups::ListScheduleGroupsError::Unhandled(inner) => Error::Unhandled(inner),
253 }
254 }
255}
256impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_schedules::ListSchedulesError, R>> for Error
257where
258 R: Send + Sync + std::fmt::Debug + 'static,
259{
260 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_schedules::ListSchedulesError, R>) -> Self {
261 match err {
262 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
263 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
264 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
265 source: err.into(),
266 }),
267 }
268 }
269}
270impl From<crate::operation::list_schedules::ListSchedulesError> for Error {
271 fn from(err: crate::operation::list_schedules::ListSchedulesError) -> Self {
272 match err {
273 crate::operation::list_schedules::ListSchedulesError::InternalServerException(inner) => Error::InternalServerException(inner),
274 crate::operation::list_schedules::ListSchedulesError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
275 crate::operation::list_schedules::ListSchedulesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
276 crate::operation::list_schedules::ListSchedulesError::ValidationException(inner) => Error::ValidationException(inner),
277 crate::operation::list_schedules::ListSchedulesError::Unhandled(inner) => Error::Unhandled(inner),
278 }
279 }
280}
281impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
282where
283 R: Send + Sync + std::fmt::Debug + 'static,
284{
285 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
286 match err {
287 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
288 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
289 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
290 source: err.into(),
291 }),
292 }
293 }
294}
295impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
296 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
297 match err {
298 crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => {
299 Error::InternalServerException(inner)
300 }
301 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
302 Error::ResourceNotFoundException(inner)
303 }
304 crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
305 crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
306 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
307 }
308 }
309}
310impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
311where
312 R: Send + Sync + std::fmt::Debug + 'static,
313{
314 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
315 match err {
316 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
317 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
318 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
319 source: err.into(),
320 }),
321 }
322 }
323}
324impl From<crate::operation::tag_resource::TagResourceError> for Error {
325 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
326 match err {
327 crate::operation::tag_resource::TagResourceError::ConflictException(inner) => Error::ConflictException(inner),
328 crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
329 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
330 crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
331 crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
332 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
333 }
334 }
335}
336impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
337where
338 R: Send + Sync + std::fmt::Debug + 'static,
339{
340 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
341 match err {
342 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
343 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
344 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
345 source: err.into(),
346 }),
347 }
348 }
349}
350impl From<crate::operation::untag_resource::UntagResourceError> for Error {
351 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
352 match err {
353 crate::operation::untag_resource::UntagResourceError::ConflictException(inner) => Error::ConflictException(inner),
354 crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
355 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
356 crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
357 crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
358 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
359 }
360 }
361}
362impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_schedule::UpdateScheduleError, R>> for Error
363where
364 R: Send + Sync + std::fmt::Debug + 'static,
365{
366 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_schedule::UpdateScheduleError, R>) -> Self {
367 match err {
368 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
369 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
370 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
371 source: err.into(),
372 }),
373 }
374 }
375}
376impl From<crate::operation::update_schedule::UpdateScheduleError> for Error {
377 fn from(err: crate::operation::update_schedule::UpdateScheduleError) -> Self {
378 match err {
379 crate::operation::update_schedule::UpdateScheduleError::ConflictException(inner) => Error::ConflictException(inner),
380 crate::operation::update_schedule::UpdateScheduleError::InternalServerException(inner) => Error::InternalServerException(inner),
381 crate::operation::update_schedule::UpdateScheduleError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
382 crate::operation::update_schedule::UpdateScheduleError::ThrottlingException(inner) => Error::ThrottlingException(inner),
383 crate::operation::update_schedule::UpdateScheduleError::ValidationException(inner) => Error::ValidationException(inner),
384 crate::operation::update_schedule::UpdateScheduleError::Unhandled(inner) => Error::Unhandled(inner),
385 }
386 }
387}
388impl ::std::error::Error for Error {
389 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
390 match self {
391 Error::ConflictException(inner) => inner.source(),
392 Error::InternalServerException(inner) => inner.source(),
393 Error::ResourceNotFoundException(inner) => inner.source(),
394 Error::ServiceQuotaExceededException(inner) => inner.source(),
395 Error::ThrottlingException(inner) => inner.source(),
396 Error::ValidationException(inner) => inner.source(),
397 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
398 }
399 }
400}
401impl ::aws_types::request_id::RequestId for Error {
402 fn request_id(&self) -> Option<&str> {
403 match self {
404 Self::ConflictException(e) => e.request_id(),
405 Self::InternalServerException(e) => e.request_id(),
406 Self::ResourceNotFoundException(e) => e.request_id(),
407 Self::ServiceQuotaExceededException(e) => e.request_id(),
408 Self::ThrottlingException(e) => e.request_id(),
409 Self::ValidationException(e) => e.request_id(),
410 Self::Unhandled(e) => e.meta.request_id(),
411 }
412 }
413}