aws_sdk_route53recoverycluster/
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>You don't have sufficient permissions to perform this action.</p>
7    AccessDeniedException(crate::types::error::AccessDeniedException),
8    /// <p>There was a conflict with this request. Try again.</p>
9    ConflictException(crate::types::error::ConflictException),
10    /// <p>The cluster endpoint isn't available. Try another cluster endpoint.</p>
11    EndpointTemporarilyUnavailableException(crate::types::error::EndpointTemporarilyUnavailableException),
12    /// <p>There was an unexpected error during processing of the request.</p>
13    InternalServerException(crate::types::error::InternalServerException),
14    /// <p>The request references a routing control or control panel that was not found.</p>
15    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
16    /// <p>The request can't update that many routing control states at the same time. Try again with fewer routing control states.</p>
17    ServiceLimitExceededException(crate::types::error::ServiceLimitExceededException),
18    /// <p>The request was denied because of request throttling.</p>
19    ThrottlingException(crate::types::error::ThrottlingException),
20    /// <p>There was a validation error on the request.</p>
21    ValidationException(crate::types::error::ValidationException),
22    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
23    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
24    variable wildcard pattern and check `.code()`:
25     \
26    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
27     \
28    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
29    Unhandled(crate::error::sealed_unhandled::Unhandled),
30}
31impl ::std::fmt::Display for Error {
32    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33        match self {
34            Error::AccessDeniedException(inner) => inner.fmt(f),
35            Error::ConflictException(inner) => inner.fmt(f),
36            Error::EndpointTemporarilyUnavailableException(inner) => inner.fmt(f),
37            Error::InternalServerException(inner) => inner.fmt(f),
38            Error::ResourceNotFoundException(inner) => inner.fmt(f),
39            Error::ServiceLimitExceededException(inner) => inner.fmt(f),
40            Error::ThrottlingException(inner) => inner.fmt(f),
41            Error::ValidationException(inner) => inner.fmt(f),
42            Error::Unhandled(_) => {
43                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
44                    write!(f, "unhandled error ({code})")
45                } else {
46                    f.write_str("unhandled error")
47                }
48            }
49        }
50    }
51}
52impl From<::aws_smithy_types::error::operation::BuildError> for Error {
53    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
54        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
55            source: value.into(),
56            meta: ::std::default::Default::default(),
57        })
58    }
59}
60impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
61    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
62        match self {
63            Self::AccessDeniedException(inner) => inner.meta(),
64            Self::ConflictException(inner) => inner.meta(),
65            Self::EndpointTemporarilyUnavailableException(inner) => inner.meta(),
66            Self::InternalServerException(inner) => inner.meta(),
67            Self::ResourceNotFoundException(inner) => inner.meta(),
68            Self::ServiceLimitExceededException(inner) => inner.meta(),
69            Self::ThrottlingException(inner) => inner.meta(),
70            Self::ValidationException(inner) => inner.meta(),
71            Self::Unhandled(inner) => &inner.meta,
72        }
73    }
74}
75impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_routing_control_state::GetRoutingControlStateError, R>>
76    for Error
77where
78    R: Send + Sync + std::fmt::Debug + 'static,
79{
80    fn from(
81        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_routing_control_state::GetRoutingControlStateError, R>,
82    ) -> Self {
83        match err {
84            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
85            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
86                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
87                source: err.into(),
88            }),
89        }
90    }
91}
92impl From<crate::operation::get_routing_control_state::GetRoutingControlStateError> for Error {
93    fn from(err: crate::operation::get_routing_control_state::GetRoutingControlStateError) -> Self {
94        match err {
95            crate::operation::get_routing_control_state::GetRoutingControlStateError::AccessDeniedException(inner) => {
96                Error::AccessDeniedException(inner)
97            }
98            crate::operation::get_routing_control_state::GetRoutingControlStateError::EndpointTemporarilyUnavailableException(inner) => {
99                Error::EndpointTemporarilyUnavailableException(inner)
100            }
101            crate::operation::get_routing_control_state::GetRoutingControlStateError::InternalServerException(inner) => {
102                Error::InternalServerException(inner)
103            }
104            crate::operation::get_routing_control_state::GetRoutingControlStateError::ResourceNotFoundException(inner) => {
105                Error::ResourceNotFoundException(inner)
106            }
107            crate::operation::get_routing_control_state::GetRoutingControlStateError::ThrottlingException(inner) => Error::ThrottlingException(inner),
108            crate::operation::get_routing_control_state::GetRoutingControlStateError::ValidationException(inner) => Error::ValidationException(inner),
109            crate::operation::get_routing_control_state::GetRoutingControlStateError::Unhandled(inner) => Error::Unhandled(inner),
110        }
111    }
112}
113impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_routing_controls::ListRoutingControlsError, R>> for Error
114where
115    R: Send + Sync + std::fmt::Debug + 'static,
116{
117    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_routing_controls::ListRoutingControlsError, R>) -> Self {
118        match err {
119            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
120            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
121                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
122                source: err.into(),
123            }),
124        }
125    }
126}
127impl From<crate::operation::list_routing_controls::ListRoutingControlsError> for Error {
128    fn from(err: crate::operation::list_routing_controls::ListRoutingControlsError) -> Self {
129        match err {
130            crate::operation::list_routing_controls::ListRoutingControlsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
131            crate::operation::list_routing_controls::ListRoutingControlsError::EndpointTemporarilyUnavailableException(inner) => {
132                Error::EndpointTemporarilyUnavailableException(inner)
133            }
134            crate::operation::list_routing_controls::ListRoutingControlsError::InternalServerException(inner) => {
135                Error::InternalServerException(inner)
136            }
137            crate::operation::list_routing_controls::ListRoutingControlsError::ResourceNotFoundException(inner) => {
138                Error::ResourceNotFoundException(inner)
139            }
140            crate::operation::list_routing_controls::ListRoutingControlsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
141            crate::operation::list_routing_controls::ListRoutingControlsError::ValidationException(inner) => Error::ValidationException(inner),
142            crate::operation::list_routing_controls::ListRoutingControlsError::Unhandled(inner) => Error::Unhandled(inner),
143        }
144    }
145}
146impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_routing_control_state::UpdateRoutingControlStateError, R>>
147    for Error
148where
149    R: Send + Sync + std::fmt::Debug + 'static,
150{
151    fn from(
152        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_routing_control_state::UpdateRoutingControlStateError, R>,
153    ) -> Self {
154        match err {
155            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
156            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
157                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
158                source: err.into(),
159            }),
160        }
161    }
162}
163impl From<crate::operation::update_routing_control_state::UpdateRoutingControlStateError> for Error {
164    fn from(err: crate::operation::update_routing_control_state::UpdateRoutingControlStateError) -> Self {
165        match err {
166            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::AccessDeniedException(inner) => {
167                Error::AccessDeniedException(inner)
168            }
169            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::ConflictException(inner) => {
170                Error::ConflictException(inner)
171            }
172            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::EndpointTemporarilyUnavailableException(inner) => {
173                Error::EndpointTemporarilyUnavailableException(inner)
174            }
175            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::InternalServerException(inner) => {
176                Error::InternalServerException(inner)
177            }
178            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::ResourceNotFoundException(inner) => {
179                Error::ResourceNotFoundException(inner)
180            }
181            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::ThrottlingException(inner) => {
182                Error::ThrottlingException(inner)
183            }
184            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::ValidationException(inner) => {
185                Error::ValidationException(inner)
186            }
187            crate::operation::update_routing_control_state::UpdateRoutingControlStateError::Unhandled(inner) => Error::Unhandled(inner),
188        }
189    }
190}
191impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_routing_control_states::UpdateRoutingControlStatesError, R>>
192    for Error
193where
194    R: Send + Sync + std::fmt::Debug + 'static,
195{
196    fn from(
197        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_routing_control_states::UpdateRoutingControlStatesError, R>,
198    ) -> Self {
199        match err {
200            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
201            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
202                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
203                source: err.into(),
204            }),
205        }
206    }
207}
208impl From<crate::operation::update_routing_control_states::UpdateRoutingControlStatesError> for Error {
209    fn from(err: crate::operation::update_routing_control_states::UpdateRoutingControlStatesError) -> Self {
210        match err {
211            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::AccessDeniedException(inner) => {
212                Error::AccessDeniedException(inner)
213            }
214            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::ConflictException(inner) => {
215                Error::ConflictException(inner)
216            }
217            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::EndpointTemporarilyUnavailableException(inner) => {
218                Error::EndpointTemporarilyUnavailableException(inner)
219            }
220            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::InternalServerException(inner) => {
221                Error::InternalServerException(inner)
222            }
223            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::ResourceNotFoundException(inner) => {
224                Error::ResourceNotFoundException(inner)
225            }
226            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::ServiceLimitExceededException(inner) => {
227                Error::ServiceLimitExceededException(inner)
228            }
229            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::ThrottlingException(inner) => {
230                Error::ThrottlingException(inner)
231            }
232            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::ValidationException(inner) => {
233                Error::ValidationException(inner)
234            }
235            crate::operation::update_routing_control_states::UpdateRoutingControlStatesError::Unhandled(inner) => Error::Unhandled(inner),
236        }
237    }
238}
239impl ::std::error::Error for Error {
240    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
241        match self {
242            Error::AccessDeniedException(inner) => inner.source(),
243            Error::ConflictException(inner) => inner.source(),
244            Error::EndpointTemporarilyUnavailableException(inner) => inner.source(),
245            Error::InternalServerException(inner) => inner.source(),
246            Error::ResourceNotFoundException(inner) => inner.source(),
247            Error::ServiceLimitExceededException(inner) => inner.source(),
248            Error::ThrottlingException(inner) => inner.source(),
249            Error::ValidationException(inner) => inner.source(),
250            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
251        }
252    }
253}
254impl ::aws_types::request_id::RequestId for Error {
255    fn request_id(&self) -> Option<&str> {
256        match self {
257            Self::AccessDeniedException(e) => e.request_id(),
258            Self::ConflictException(e) => e.request_id(),
259            Self::EndpointTemporarilyUnavailableException(e) => e.request_id(),
260            Self::InternalServerException(e) => e.request_id(),
261            Self::ResourceNotFoundException(e) => e.request_id(),
262            Self::ServiceLimitExceededException(e) => e.request_id(),
263            Self::ThrottlingException(e) => e.request_id(),
264            Self::ValidationException(e) => e.request_id(),
265            Self::Unhandled(e) => e.meta.request_id(),
266        }
267    }
268}