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