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