1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* ServiceErrorGenerator.kt:252 */
|
2 3 | /// All possible error types for this service.
|
4 + | /* RustType.kt:516 */
|
3 5 | #[non_exhaustive]
|
6 + | /* RustType.kt:516 */
|
4 7 | #[derive(::std::fmt::Debug)]
|
5 - | pub enum Error {
|
8 + | pub /* ServiceErrorGenerator.kt:257 */ enum Error {
|
9 + | /* ServiceErrorGenerator.kt:259 */
|
6 10 | #[allow(missing_docs)] // documentation missing in model
|
11 + | /* ServiceErrorGenerator.kt:262 */
|
7 12 | CollidingError(crate::types::error::CollidingError),
|
8 - | /// This will be renamed to CollidingError
|
13 + | /// /* ServiceErrorGenerator.kt:259 */This will be renamed to CollidingError
|
14 + | /* ServiceErrorGenerator.kt:262 */
|
9 15 | CollidingException(crate::types::error::CollidingException),
|
10 - | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
16 + | /// /* ServiceErrorGenerator.kt:259 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
17 + | /* ServiceErrorGenerator.kt:262 */
|
11 18 | ValidationException(crate::types::error::ValidationException),
|
12 - | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
19 + | /// /* ServiceErrorGenerator.kt:264 */An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
20 + | /* ServiceErrorGenerator.kt:320 */
|
13 21 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
14 22 | variable wildcard pattern and check `.code()`:
|
15 23 | \
|
16 24 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
17 25 | \
|
18 26 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
|
19 - | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
27 + | /* ServiceErrorGenerator.kt:266 */
|
28 + | Unhandled(crate::error::sealed_unhandled::Unhandled), /* ServiceErrorGenerator.kt:257 */
|
20 29 | }
|
30 + | /* ServiceErrorGenerator.kt:131 */
|
21 31 | impl ::std::fmt::Display for Error {
|
32 + | /* ServiceErrorGenerator.kt:132 */
|
22 33 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
34 + | /* ServiceErrorGenerator.kt:133 */
|
23 35 | match self {
|
24 - | Error::CollidingError(inner) => inner.fmt(f),
|
25 - | Error::CollidingException(inner) => inner.fmt(f),
|
26 - | Error::ValidationException(inner) => inner.fmt(f),
|
36 + | /* ServiceErrorGenerator.kt:135 */ Error::CollidingError(inner) => inner.fmt(f),
|
37 + | /* ServiceErrorGenerator.kt:135 */ Error::CollidingException(inner) => inner.fmt(f),
|
38 + | /* ServiceErrorGenerator.kt:135 */ Error::ValidationException(inner) => inner.fmt(f),
|
39 + | /* ServiceErrorGenerator.kt:137 */
|
27 40 | Error::Unhandled(_) => {
|
28 41 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
29 42 | write!(f, "unhandled error ({code})")
|
30 43 | } else {
|
31 44 | f.write_str("unhandled error")
|
32 45 | }
|
33 - | }
|
46 + | } /* ServiceErrorGenerator.kt:133 */
|
34 47 | }
|
48 + | /* ServiceErrorGenerator.kt:132 */
|
35 49 | }
|
50 + | /* ServiceErrorGenerator.kt:131 */
|
36 51 | }
|
52 + | /* ServiceErrorGenerator.kt:154 */
|
37 53 | impl From<::aws_smithy_types::error::operation::BuildError> for Error {
|
38 54 | fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
|
39 55 | Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
40 56 | source: value.into(),
|
41 57 | meta: ::std::default::Default::default(),
|
42 58 | })
|
43 59 | }
|
44 60 | }
|
61 + | /* ServiceErrorGenerator.kt:223 */
|
45 62 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
|
46 63 | fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
|
47 64 | match self {
|
48 65 | Self::CollidingError(inner) => inner.meta(),
|
49 66 | Self::CollidingException(inner) => inner.meta(),
|
50 67 | Self::ValidationException(inner) => inner.meta(),
|
51 68 | Self::Unhandled(inner) => &inner.meta,
|
52 69 | }
|
53 70 | }
|
54 71 | }
|
72 + | /* ServiceErrorGenerator.kt:174 */
|
55 73 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::err_collisions::ErrCollisionsError, R>> for Error
|
56 74 | where
|
57 75 | R: Send + Sync + std::fmt::Debug + 'static,
|
58 76 | {
|
77 + | /* ServiceErrorGenerator.kt:179 */
|
59 78 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::err_collisions::ErrCollisionsError, R>) -> Self {
|
79 + | /* ServiceErrorGenerator.kt:184 */
|
60 80 | match err {
|
81 + | /* ServiceErrorGenerator.kt:185 */
|
61 82 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
83 + | /* ServiceErrorGenerator.kt:186 */
|
62 84 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
63 85 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
64 86 | source: err.into(),
|
65 87 | }),
|
88 + | /* ServiceErrorGenerator.kt:184 */
|
66 89 | }
|
90 + | /* ServiceErrorGenerator.kt:179 */
|
67 91 | }
|
92 + | /* ServiceErrorGenerator.kt:174 */
|
68 93 | }
|
94 + | /* ServiceErrorGenerator.kt:202 */
|
69 95 | impl From<crate::operation::err_collisions::ErrCollisionsError> for Error {
|
96 + | /* ServiceErrorGenerator.kt:203 */
|
70 97 | fn from(err: crate::operation::err_collisions::ErrCollisionsError) -> Self {
|
98 + | /* ServiceErrorGenerator.kt:204 */
|
71 99 | match err {
|
100 + | /* ServiceErrorGenerator.kt:207 */
|
72 101 | crate::operation::err_collisions::ErrCollisionsError::CollidingError(inner) => Error::CollidingError(inner),
|
102 + | /* ServiceErrorGenerator.kt:207 */
|
73 103 | crate::operation::err_collisions::ErrCollisionsError::CollidingException(inner) => Error::CollidingException(inner),
|
104 + | /* ServiceErrorGenerator.kt:212 */
|
74 105 | crate::operation::err_collisions::ErrCollisionsError::Unhandled(inner) => Error::Unhandled(inner),
|
106 + | /* ServiceErrorGenerator.kt:204 */
|
75 107 | }
|
108 + | /* ServiceErrorGenerator.kt:203 */
|
76 109 | }
|
110 + | /* ServiceErrorGenerator.kt:202 */
|
77 111 | }
|
112 + | /* ServiceErrorGenerator.kt:174 */
|
78 113 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::match_::MatchError, R>> for Error
|
79 114 | where
|
80 115 | R: Send + Sync + std::fmt::Debug + 'static,
|
81 116 | {
|
117 + | /* ServiceErrorGenerator.kt:179 */
|
82 118 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::match_::MatchError, R>) -> Self {
|
119 + | /* ServiceErrorGenerator.kt:184 */
|
83 120 | match err {
|
121 + | /* ServiceErrorGenerator.kt:185 */
|
84 122 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
123 + | /* ServiceErrorGenerator.kt:186 */
|
85 124 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
86 125 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
87 126 | source: err.into(),
|
88 127 | }),
|
128 + | /* ServiceErrorGenerator.kt:184 */
|
89 129 | }
|
130 + | /* ServiceErrorGenerator.kt:179 */
|
90 131 | }
|
132 + | /* ServiceErrorGenerator.kt:174 */
|
91 133 | }
|
134 + | /* ServiceErrorGenerator.kt:202 */
|
92 135 | impl From<crate::operation::match_::MatchError> for Error {
|
136 + | /* ServiceErrorGenerator.kt:203 */
|
93 137 | fn from(err: crate::operation::match_::MatchError) -> Self {
|
138 + | /* ServiceErrorGenerator.kt:204 */
|
94 139 | match err {
|
140 + | /* ServiceErrorGenerator.kt:207 */
|
95 141 | crate::operation::match_::MatchError::ValidationException(inner) => Error::ValidationException(inner),
|
142 + | /* ServiceErrorGenerator.kt:212 */
|
96 143 | crate::operation::match_::MatchError::Unhandled(inner) => Error::Unhandled(inner),
|
144 + | /* ServiceErrorGenerator.kt:204 */
|
97 145 | }
|
146 + | /* ServiceErrorGenerator.kt:203 */
|
98 147 | }
|
148 + | /* ServiceErrorGenerator.kt:202 */
|
99 149 | }
|
150 + | /* ServiceErrorGenerator.kt:174 */
|
100 151 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::option::OptionError, R>> for Error
|
101 152 | where
|
102 153 | R: Send + Sync + std::fmt::Debug + 'static,
|
103 154 | {
|
155 + | /* ServiceErrorGenerator.kt:179 */
|
104 156 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::option::OptionError, R>) -> Self {
|
157 + | /* ServiceErrorGenerator.kt:184 */
|
105 158 | match err {
|
159 + | /* ServiceErrorGenerator.kt:185 */
|
106 160 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
161 + | /* ServiceErrorGenerator.kt:186 */
|
107 162 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
108 163 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
109 164 | source: err.into(),
|
110 165 | }),
|
166 + | /* ServiceErrorGenerator.kt:184 */
|
111 167 | }
|
168 + | /* ServiceErrorGenerator.kt:179 */
|
112 169 | }
|
170 + | /* ServiceErrorGenerator.kt:174 */
|
113 171 | }
|
172 + | /* ServiceErrorGenerator.kt:202 */
|
114 173 | impl From<crate::operation::option::OptionError> for Error {
|
174 + | /* ServiceErrorGenerator.kt:203 */
|
115 175 | fn from(err: crate::operation::option::OptionError) -> Self {
|
176 + | /* ServiceErrorGenerator.kt:204 */
|
116 177 | match err {
|
178 + | /* ServiceErrorGenerator.kt:212 */
|
117 179 | crate::operation::option::OptionError::Unhandled(inner) => Error::Unhandled(inner),
|
180 + | /* ServiceErrorGenerator.kt:204 */
|
118 181 | }
|
182 + | /* ServiceErrorGenerator.kt:203 */
|
119 183 | }
|
184 + | /* ServiceErrorGenerator.kt:202 */
|
120 185 | }
|
186 + | /* ServiceErrorGenerator.kt:174 */
|
121 187 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::reserved_words_as_members::ReservedWordsAsMembersError, R>>
|
122 188 | for Error
|
123 189 | where
|
124 190 | R: Send + Sync + std::fmt::Debug + 'static,
|
125 191 | {
|
192 + | /* ServiceErrorGenerator.kt:179 */
|
126 193 | fn from(
|
127 194 | err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::reserved_words_as_members::ReservedWordsAsMembersError, R>,
|
128 195 | ) -> Self {
|
196 + | /* ServiceErrorGenerator.kt:184 */
|
129 197 | match err {
|
198 + | /* ServiceErrorGenerator.kt:185 */
|
130 199 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
200 + | /* ServiceErrorGenerator.kt:186 */
|
131 201 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
132 202 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
133 203 | source: err.into(),
|
134 204 | }),
|
205 + | /* ServiceErrorGenerator.kt:184 */
|
135 206 | }
|
207 + | /* ServiceErrorGenerator.kt:179 */
|
136 208 | }
|
209 + | /* ServiceErrorGenerator.kt:174 */
|
137 210 | }
|
211 + | /* ServiceErrorGenerator.kt:202 */
|
138 212 | impl From<crate::operation::reserved_words_as_members::ReservedWordsAsMembersError> for Error {
|
213 + | /* ServiceErrorGenerator.kt:203 */
|
139 214 | fn from(err: crate::operation::reserved_words_as_members::ReservedWordsAsMembersError) -> Self {
|
215 + | /* ServiceErrorGenerator.kt:204 */
|
140 216 | match err {
|
217 + | /* ServiceErrorGenerator.kt:207 */
|
141 218 | crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::ValidationException(inner) => Error::ValidationException(inner),
|
219 + | /* ServiceErrorGenerator.kt:212 */
|
142 220 | crate::operation::reserved_words_as_members::ReservedWordsAsMembersError::Unhandled(inner) => Error::Unhandled(inner),
|
221 + | /* ServiceErrorGenerator.kt:204 */
|
143 222 | }
|
223 + | /* ServiceErrorGenerator.kt:203 */
|
144 224 | }
|
225 + | /* ServiceErrorGenerator.kt:202 */
|
145 226 | }
|
227 + | /* ServiceErrorGenerator.kt:174 */
|
146 228 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::result::ResultError, R>> for Error
|
147 229 | where
|
148 230 | R: Send + Sync + std::fmt::Debug + 'static,
|
149 231 | {
|
232 + | /* ServiceErrorGenerator.kt:179 */
|
150 233 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::result::ResultError, R>) -> Self {
|
234 + | /* ServiceErrorGenerator.kt:184 */
|
151 235 | match err {
|
236 + | /* ServiceErrorGenerator.kt:185 */
|
152 237 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
238 + | /* ServiceErrorGenerator.kt:186 */
|
153 239 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
154 240 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
155 241 | source: err.into(),
|
156 242 | }),
|
243 + | /* ServiceErrorGenerator.kt:184 */
|
157 244 | }
|
245 + | /* ServiceErrorGenerator.kt:179 */
|
158 246 | }
|
247 + | /* ServiceErrorGenerator.kt:174 */
|
159 248 | }
|
249 + | /* ServiceErrorGenerator.kt:202 */
|
160 250 | impl From<crate::operation::result::ResultError> for Error {
|
251 + | /* ServiceErrorGenerator.kt:203 */
|
161 252 | fn from(err: crate::operation::result::ResultError) -> Self {
|
253 + | /* ServiceErrorGenerator.kt:204 */
|
162 254 | match err {
|
255 + | /* ServiceErrorGenerator.kt:212 */
|
163 256 | crate::operation::result::ResultError::Unhandled(inner) => Error::Unhandled(inner),
|
257 + | /* ServiceErrorGenerator.kt:204 */
|
164 258 | }
|
259 + | /* ServiceErrorGenerator.kt:203 */
|
165 260 | }
|
261 + | /* ServiceErrorGenerator.kt:202 */
|
166 262 | }
|
263 + | /* ServiceErrorGenerator.kt:174 */
|
167 264 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::rpc_echo::RPCEchoError, R>> for Error
|
168 265 | where
|
169 266 | R: Send + Sync + std::fmt::Debug + 'static,
|
170 267 | {
|
268 + | /* ServiceErrorGenerator.kt:179 */
|
171 269 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::rpc_echo::RPCEchoError, R>) -> Self {
|
270 + | /* ServiceErrorGenerator.kt:184 */
|
172 271 | match err {
|
272 + | /* ServiceErrorGenerator.kt:185 */
|
173 273 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
274 + | /* ServiceErrorGenerator.kt:186 */
|
174 275 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
175 276 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
176 277 | source: err.into(),
|
177 278 | }),
|
279 + | /* ServiceErrorGenerator.kt:184 */
|
178 280 | }
|
281 + | /* ServiceErrorGenerator.kt:179 */
|
179 282 | }
|
283 + | /* ServiceErrorGenerator.kt:174 */
|
180 284 | }
|
285 + | /* ServiceErrorGenerator.kt:202 */
|
181 286 | impl From<crate::operation::rpc_echo::RPCEchoError> for Error {
|
287 + | /* ServiceErrorGenerator.kt:203 */
|
182 288 | fn from(err: crate::operation::rpc_echo::RPCEchoError) -> Self {
|
289 + | /* ServiceErrorGenerator.kt:204 */
|
183 290 | match err {
|
291 + | /* ServiceErrorGenerator.kt:207 */
|
184 292 | crate::operation::rpc_echo::RPCEchoError::ValidationException(inner) => Error::ValidationException(inner),
|
293 + | /* ServiceErrorGenerator.kt:212 */
|
185 294 | crate::operation::rpc_echo::RPCEchoError::Unhandled(inner) => Error::Unhandled(inner),
|
295 + | /* ServiceErrorGenerator.kt:204 */
|
186 296 | }
|
297 + | /* ServiceErrorGenerator.kt:203 */
|
187 298 | }
|
299 + | /* ServiceErrorGenerator.kt:202 */
|
188 300 | }
|
301 + | /* ServiceErrorGenerator.kt:174 */
|
189 302 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::structure_name_punning::StructureNamePunningError, R>> for Error
|
190 303 | where
|
191 304 | R: Send + Sync + std::fmt::Debug + 'static,
|
192 305 | {
|
306 + | /* ServiceErrorGenerator.kt:179 */
|
193 307 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::structure_name_punning::StructureNamePunningError, R>) -> Self {
|
308 + | /* ServiceErrorGenerator.kt:184 */
|
194 309 | match err {
|
310 + | /* ServiceErrorGenerator.kt:185 */
|
195 311 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
312 + | /* ServiceErrorGenerator.kt:186 */
|
196 313 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
197 314 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
198 315 | source: err.into(),
|
199 316 | }),
|
317 + | /* ServiceErrorGenerator.kt:184 */
|
200 318 | }
|
319 + | /* ServiceErrorGenerator.kt:179 */
|
201 320 | }
|
321 + | /* ServiceErrorGenerator.kt:174 */
|
202 322 | }
|
323 + | /* ServiceErrorGenerator.kt:202 */
|
203 324 | impl From<crate::operation::structure_name_punning::StructureNamePunningError> for Error {
|
325 + | /* ServiceErrorGenerator.kt:203 */
|
204 326 | fn from(err: crate::operation::structure_name_punning::StructureNamePunningError) -> Self {
|
327 + | /* ServiceErrorGenerator.kt:204 */
|
205 328 | match err {
|
329 + | /* ServiceErrorGenerator.kt:212 */
|
206 330 | crate::operation::structure_name_punning::StructureNamePunningError::Unhandled(inner) => Error::Unhandled(inner),
|
331 + | /* ServiceErrorGenerator.kt:204 */
|
207 332 | }
|
333 + | /* ServiceErrorGenerator.kt:203 */
|
208 334 | }
|
335 + | /* ServiceErrorGenerator.kt:202 */
|
209 336 | }
|
337 + | /* ServiceErrorGenerator.kt:115 */
|
210 338 | impl ::std::error::Error for Error {
|
339 + | /* ServiceErrorGenerator.kt:116 */
|
211 340 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
341 + | /* ServiceErrorGenerator.kt:117 */
|
212 342 | match self {
|
213 - | Error::CollidingError(inner) => inner.source(),
|
214 - | Error::CollidingException(inner) => inner.source(),
|
215 - | Error::ValidationException(inner) => inner.source(),
|
216 - | Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
|
343 + | /* ServiceErrorGenerator.kt:119 */ Error::CollidingError(inner) => inner.source(),
|
344 + | /* ServiceErrorGenerator.kt:119 */ Error::CollidingException(inner) => inner.source(),
|
345 + | /* ServiceErrorGenerator.kt:119 */ Error::ValidationException(inner) => inner.source(),
|
346 + | /* ServiceErrorGenerator.kt:121 */
|
347 + | Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source), /* ServiceErrorGenerator.kt:117 */
|
217 348 | }
|
349 + | /* ServiceErrorGenerator.kt:116 */
|
218 350 | }
|
351 + | /* ServiceErrorGenerator.kt:115 */
|
219 352 | }
|