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