1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 AccessDeniedException(crate::types::error::AccessDeniedException),
8 ConflictException(crate::types::error::ConflictException),
10 InternalServerException(crate::types::error::InternalServerException),
12 ModelErrorException(crate::types::error::ModelErrorException),
14 ModelNotReadyException(crate::types::error::ModelNotReadyException),
16 ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
18 ModelTimeoutException(crate::types::error::ModelTimeoutException),
20 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
22 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
24 ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
26 ThrottlingException(crate::types::error::ThrottlingException),
28 ValidationException(crate::types::error::ValidationException),
30 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
32 variable wildcard pattern and check `.code()`:
33 \
34 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
35 \
36 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
37 Unhandled(crate::error::sealed_unhandled::Unhandled),
38}
39impl ::std::fmt::Display for Error {
40 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
41 match self {
42 Error::AccessDeniedException(inner) => inner.fmt(f),
43 Error::ConflictException(inner) => inner.fmt(f),
44 Error::InternalServerException(inner) => inner.fmt(f),
45 Error::ModelErrorException(inner) => inner.fmt(f),
46 Error::ModelNotReadyException(inner) => inner.fmt(f),
47 Error::ModelStreamErrorException(inner) => inner.fmt(f),
48 Error::ModelTimeoutException(inner) => inner.fmt(f),
49 Error::ResourceNotFoundException(inner) => inner.fmt(f),
50 Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
51 Error::ServiceUnavailableException(inner) => inner.fmt(f),
52 Error::ThrottlingException(inner) => inner.fmt(f),
53 Error::ValidationException(inner) => inner.fmt(f),
54 Error::Unhandled(_) => {
55 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
56 write!(f, "unhandled error ({code})")
57 } else {
58 f.write_str("unhandled error")
59 }
60 }
61 }
62 }
63}
64impl From<::aws_smithy_types::error::operation::BuildError> for Error {
65 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
66 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
67 source: value.into(),
68 meta: ::std::default::Default::default(),
69 })
70 }
71}
72impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
73 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
74 match self {
75 Self::AccessDeniedException(inner) => inner.meta(),
76 Self::ConflictException(inner) => inner.meta(),
77 Self::InternalServerException(inner) => inner.meta(),
78 Self::ModelErrorException(inner) => inner.meta(),
79 Self::ModelNotReadyException(inner) => inner.meta(),
80 Self::ModelStreamErrorException(inner) => inner.meta(),
81 Self::ModelTimeoutException(inner) => inner.meta(),
82 Self::ResourceNotFoundException(inner) => inner.meta(),
83 Self::ServiceQuotaExceededException(inner) => inner.meta(),
84 Self::ServiceUnavailableException(inner) => inner.meta(),
85 Self::ThrottlingException(inner) => inner.meta(),
86 Self::ValidationException(inner) => inner.meta(),
87 Self::Unhandled(inner) => &inner.meta,
88 }
89 }
90}
91impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::apply_guardrail::ApplyGuardrailError, R>> for Error
92where
93 R: Send + Sync + std::fmt::Debug + 'static,
94{
95 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::apply_guardrail::ApplyGuardrailError, R>) -> Self {
96 match err {
97 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
98 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
99 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
100 source: err.into(),
101 }),
102 }
103 }
104}
105impl From<crate::operation::apply_guardrail::ApplyGuardrailError> for Error {
106 fn from(err: crate::operation::apply_guardrail::ApplyGuardrailError) -> Self {
107 match err {
108 crate::operation::apply_guardrail::ApplyGuardrailError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
109 crate::operation::apply_guardrail::ApplyGuardrailError::InternalServerException(inner) => Error::InternalServerException(inner),
110 crate::operation::apply_guardrail::ApplyGuardrailError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
111 crate::operation::apply_guardrail::ApplyGuardrailError::ServiceQuotaExceededException(inner) => {
112 Error::ServiceQuotaExceededException(inner)
113 }
114 crate::operation::apply_guardrail::ApplyGuardrailError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
115 crate::operation::apply_guardrail::ApplyGuardrailError::ThrottlingException(inner) => Error::ThrottlingException(inner),
116 crate::operation::apply_guardrail::ApplyGuardrailError::ValidationException(inner) => Error::ValidationException(inner),
117 crate::operation::apply_guardrail::ApplyGuardrailError::Unhandled(inner) => Error::Unhandled(inner),
118 }
119 }
120}
121impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse::ConverseError, R>> for Error
122where
123 R: Send + Sync + std::fmt::Debug + 'static,
124{
125 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse::ConverseError, R>) -> Self {
126 match err {
127 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
128 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
129 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
130 source: err.into(),
131 }),
132 }
133 }
134}
135impl From<crate::operation::converse::ConverseError> for Error {
136 fn from(err: crate::operation::converse::ConverseError) -> Self {
137 match err {
138 crate::operation::converse::ConverseError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
139 crate::operation::converse::ConverseError::InternalServerException(inner) => Error::InternalServerException(inner),
140 crate::operation::converse::ConverseError::ModelErrorException(inner) => Error::ModelErrorException(inner),
141 crate::operation::converse::ConverseError::ModelNotReadyException(inner) => Error::ModelNotReadyException(inner),
142 crate::operation::converse::ConverseError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
143 crate::operation::converse::ConverseError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
144 crate::operation::converse::ConverseError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
145 crate::operation::converse::ConverseError::ThrottlingException(inner) => Error::ThrottlingException(inner),
146 crate::operation::converse::ConverseError::ValidationException(inner) => Error::ValidationException(inner),
147 crate::operation::converse::ConverseError::Unhandled(inner) => Error::Unhandled(inner),
148 }
149 }
150}
151impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse_stream::ConverseStreamError, R>> for Error
152where
153 R: Send + Sync + std::fmt::Debug + 'static,
154{
155 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse_stream::ConverseStreamError, R>) -> Self {
156 match err {
157 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
158 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
159 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
160 source: err.into(),
161 }),
162 }
163 }
164}
165impl From<crate::operation::converse_stream::ConverseStreamError> for Error {
166 fn from(err: crate::operation::converse_stream::ConverseStreamError) -> Self {
167 match err {
168 crate::operation::converse_stream::ConverseStreamError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
169 crate::operation::converse_stream::ConverseStreamError::InternalServerException(inner) => Error::InternalServerException(inner),
170 crate::operation::converse_stream::ConverseStreamError::ModelErrorException(inner) => Error::ModelErrorException(inner),
171 crate::operation::converse_stream::ConverseStreamError::ModelNotReadyException(inner) => Error::ModelNotReadyException(inner),
172 crate::operation::converse_stream::ConverseStreamError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
173 crate::operation::converse_stream::ConverseStreamError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
174 crate::operation::converse_stream::ConverseStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
175 crate::operation::converse_stream::ConverseStreamError::ThrottlingException(inner) => Error::ThrottlingException(inner),
176 crate::operation::converse_stream::ConverseStreamError::ValidationException(inner) => Error::ValidationException(inner),
177 crate::operation::converse_stream::ConverseStreamError::ModelStreamErrorException(inner) => Error::ModelStreamErrorException(inner),
178 crate::operation::converse_stream::ConverseStreamError::Unhandled(inner) => Error::Unhandled(inner),
179 }
180 }
181}
182impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::count_tokens::CountTokensError, R>> for Error
183where
184 R: Send + Sync + std::fmt::Debug + 'static,
185{
186 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::count_tokens::CountTokensError, R>) -> Self {
187 match err {
188 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
189 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
190 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
191 source: err.into(),
192 }),
193 }
194 }
195}
196impl From<crate::operation::count_tokens::CountTokensError> for Error {
197 fn from(err: crate::operation::count_tokens::CountTokensError) -> Self {
198 match err {
199 crate::operation::count_tokens::CountTokensError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
200 crate::operation::count_tokens::CountTokensError::InternalServerException(inner) => Error::InternalServerException(inner),
201 crate::operation::count_tokens::CountTokensError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
202 crate::operation::count_tokens::CountTokensError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
203 crate::operation::count_tokens::CountTokensError::ThrottlingException(inner) => Error::ThrottlingException(inner),
204 crate::operation::count_tokens::CountTokensError::ValidationException(inner) => Error::ValidationException(inner),
205 crate::operation::count_tokens::CountTokensError::Unhandled(inner) => Error::Unhandled(inner),
206 }
207 }
208}
209impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_async_invoke::GetAsyncInvokeError, R>> for Error
210where
211 R: Send + Sync + std::fmt::Debug + 'static,
212{
213 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_async_invoke::GetAsyncInvokeError, R>) -> Self {
214 match err {
215 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
216 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
217 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
218 source: err.into(),
219 }),
220 }
221 }
222}
223impl From<crate::operation::get_async_invoke::GetAsyncInvokeError> for Error {
224 fn from(err: crate::operation::get_async_invoke::GetAsyncInvokeError) -> Self {
225 match err {
226 crate::operation::get_async_invoke::GetAsyncInvokeError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
227 crate::operation::get_async_invoke::GetAsyncInvokeError::InternalServerException(inner) => Error::InternalServerException(inner),
228 crate::operation::get_async_invoke::GetAsyncInvokeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
229 crate::operation::get_async_invoke::GetAsyncInvokeError::ValidationException(inner) => Error::ValidationException(inner),
230 crate::operation::get_async_invoke::GetAsyncInvokeError::Unhandled(inner) => Error::Unhandled(inner),
231 }
232 }
233}
234impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError, R>> for Error
235where
236 R: Send + Sync + std::fmt::Debug + 'static,
237{
238 fn from(
239 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError, R>,
240 ) -> Self {
241 match err {
242 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
243 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
244 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
245 source: err.into(),
246 }),
247 }
248 }
249}
250impl From<crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError> for Error {
251 fn from(err: crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError) -> Self {
252 match err {
253 crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError::AccessDeniedException(inner) => {
254 Error::AccessDeniedException(inner)
255 }
256 crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError::InternalServerException(inner) => {
257 Error::InternalServerException(inner)
258 }
259 crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError::ServiceUnavailableException(inner) => {
260 Error::ServiceUnavailableException(inner)
261 }
262 crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError::ThrottlingException(inner) => Error::ThrottlingException(inner),
263 crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError::ValidationException(inner) => Error::ValidationException(inner),
264 crate::operation::invoke_guardrail_checks::InvokeGuardrailChecksError::Unhandled(inner) => Error::Unhandled(inner),
265 }
266 }
267}
268impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::invoke_model::InvokeModelError, R>> for Error
269where
270 R: Send + Sync + std::fmt::Debug + 'static,
271{
272 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::invoke_model::InvokeModelError, R>) -> Self {
273 match err {
274 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
275 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
276 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
277 source: err.into(),
278 }),
279 }
280 }
281}
282impl From<crate::operation::invoke_model::InvokeModelError> for Error {
283 fn from(err: crate::operation::invoke_model::InvokeModelError) -> Self {
284 match err {
285 crate::operation::invoke_model::InvokeModelError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
286 crate::operation::invoke_model::InvokeModelError::InternalServerException(inner) => Error::InternalServerException(inner),
287 crate::operation::invoke_model::InvokeModelError::ModelErrorException(inner) => Error::ModelErrorException(inner),
288 crate::operation::invoke_model::InvokeModelError::ModelNotReadyException(inner) => Error::ModelNotReadyException(inner),
289 crate::operation::invoke_model::InvokeModelError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
290 crate::operation::invoke_model::InvokeModelError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
291 crate::operation::invoke_model::InvokeModelError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
292 crate::operation::invoke_model::InvokeModelError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
293 crate::operation::invoke_model::InvokeModelError::ThrottlingException(inner) => Error::ThrottlingException(inner),
294 crate::operation::invoke_model::InvokeModelError::ValidationException(inner) => Error::ValidationException(inner),
295 crate::operation::invoke_model::InvokeModelError::Unhandled(inner) => Error::Unhandled(inner),
296 }
297 }
298}
299impl<R>
300 From<
301 ::aws_smithy_runtime_api::client::result::SdkError<
302 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
303 R,
304 >,
305 > for Error
306where
307 R: Send + Sync + std::fmt::Debug + 'static,
308{
309 fn from(
310 err: ::aws_smithy_runtime_api::client::result::SdkError<
311 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
312 R,
313 >,
314 ) -> Self {
315 match err {
316 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
317 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
318 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
319 source: err.into(),
320 }),
321 }
322 }
323}
324impl From<crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError> for Error {
325 fn from(err: crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError) -> Self {
326 match err {
327 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::AccessDeniedException(inner) => {
328 Error::AccessDeniedException(inner)
329 }
330 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::InternalServerException(inner) => {
331 Error::InternalServerException(inner)
332 }
333 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelErrorException(inner) => {
334 Error::ModelErrorException(inner)
335 }
336 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelNotReadyException(inner) => {
337 Error::ModelNotReadyException(inner)
338 }
339 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelStreamErrorException(inner) => {
340 Error::ModelStreamErrorException(inner)
341 }
342 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelTimeoutException(inner) => {
343 Error::ModelTimeoutException(inner)
344 }
345 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ResourceNotFoundException(inner) => {
346 Error::ResourceNotFoundException(inner)
347 }
348 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ServiceQuotaExceededException(
349 inner,
350 ) => Error::ServiceQuotaExceededException(inner),
351 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ServiceUnavailableException(inner) => {
352 Error::ServiceUnavailableException(inner)
353 }
354 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ThrottlingException(inner) => {
355 Error::ThrottlingException(inner)
356 }
357 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ValidationException(inner) => {
358 Error::ValidationException(inner)
359 }
360 crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::Unhandled(inner) => {
361 Error::Unhandled(inner)
362 }
363 }
364 }
365}
366impl<R>
367 From<
368 ::aws_smithy_runtime_api::client::result::SdkError<
369 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError,
370 R,
371 >,
372 > for Error
373where
374 R: Send + Sync + std::fmt::Debug + 'static,
375{
376 fn from(
377 err: ::aws_smithy_runtime_api::client::result::SdkError<
378 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError,
379 R,
380 >,
381 ) -> Self {
382 match err {
383 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
384 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
385 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
386 source: err.into(),
387 }),
388 }
389 }
390}
391impl From<crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError> for Error {
392 fn from(err: crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError) -> Self {
393 match err {
394 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::AccessDeniedException(inner) => {
395 Error::AccessDeniedException(inner)
396 }
397 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::InternalServerException(inner) => {
398 Error::InternalServerException(inner)
399 }
400 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelErrorException(inner) => {
401 Error::ModelErrorException(inner)
402 }
403 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelNotReadyException(inner) => {
404 Error::ModelNotReadyException(inner)
405 }
406 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelStreamErrorException(inner) => {
407 Error::ModelStreamErrorException(inner)
408 }
409 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelTimeoutException(inner) => {
410 Error::ModelTimeoutException(inner)
411 }
412 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ResourceNotFoundException(inner) => {
413 Error::ResourceNotFoundException(inner)
414 }
415 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ServiceQuotaExceededException(inner) => {
416 Error::ServiceQuotaExceededException(inner)
417 }
418 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ServiceUnavailableException(inner) => {
419 Error::ServiceUnavailableException(inner)
420 }
421 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ThrottlingException(inner) => {
422 Error::ThrottlingException(inner)
423 }
424 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ValidationException(inner) => {
425 Error::ValidationException(inner)
426 }
427 crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::Unhandled(inner) => Error::Unhandled(inner),
428 }
429 }
430}
431impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_async_invokes::ListAsyncInvokesError, R>> for Error
432where
433 R: Send + Sync + std::fmt::Debug + 'static,
434{
435 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_async_invokes::ListAsyncInvokesError, R>) -> Self {
436 match err {
437 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
438 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
439 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
440 source: err.into(),
441 }),
442 }
443 }
444}
445impl From<crate::operation::list_async_invokes::ListAsyncInvokesError> for Error {
446 fn from(err: crate::operation::list_async_invokes::ListAsyncInvokesError) -> Self {
447 match err {
448 crate::operation::list_async_invokes::ListAsyncInvokesError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
449 crate::operation::list_async_invokes::ListAsyncInvokesError::InternalServerException(inner) => Error::InternalServerException(inner),
450 crate::operation::list_async_invokes::ListAsyncInvokesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
451 crate::operation::list_async_invokes::ListAsyncInvokesError::ValidationException(inner) => Error::ValidationException(inner),
452 crate::operation::list_async_invokes::ListAsyncInvokesError::Unhandled(inner) => Error::Unhandled(inner),
453 }
454 }
455}
456impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_async_invoke::StartAsyncInvokeError, R>> for Error
457where
458 R: Send + Sync + std::fmt::Debug + 'static,
459{
460 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_async_invoke::StartAsyncInvokeError, R>) -> Self {
461 match err {
462 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
463 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
464 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
465 source: err.into(),
466 }),
467 }
468 }
469}
470impl From<crate::operation::start_async_invoke::StartAsyncInvokeError> for Error {
471 fn from(err: crate::operation::start_async_invoke::StartAsyncInvokeError) -> Self {
472 match err {
473 crate::operation::start_async_invoke::StartAsyncInvokeError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
474 crate::operation::start_async_invoke::StartAsyncInvokeError::ConflictException(inner) => Error::ConflictException(inner),
475 crate::operation::start_async_invoke::StartAsyncInvokeError::InternalServerException(inner) => Error::InternalServerException(inner),
476 crate::operation::start_async_invoke::StartAsyncInvokeError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
477 crate::operation::start_async_invoke::StartAsyncInvokeError::ServiceQuotaExceededException(inner) => {
478 Error::ServiceQuotaExceededException(inner)
479 }
480 crate::operation::start_async_invoke::StartAsyncInvokeError::ServiceUnavailableException(inner) => {
481 Error::ServiceUnavailableException(inner)
482 }
483 crate::operation::start_async_invoke::StartAsyncInvokeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
484 crate::operation::start_async_invoke::StartAsyncInvokeError::ValidationException(inner) => Error::ValidationException(inner),
485 crate::operation::start_async_invoke::StartAsyncInvokeError::Unhandled(inner) => Error::Unhandled(inner),
486 }
487 }
488}
489impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ConverseStreamOutputError, R>> for Error
490where
491 R: Send + Sync + std::fmt::Debug + 'static,
492{
493 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ConverseStreamOutputError, R>) -> Self {
494 match err {
495 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
496 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
497 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
498 source: err.into(),
499 }),
500 }
501 }
502}
503impl From<crate::types::error::ConverseStreamOutputError> for Error {
504 fn from(err: crate::types::error::ConverseStreamOutputError) -> Self {
505 match err {
506 crate::types::error::ConverseStreamOutputError::InternalServerException(inner) => Error::InternalServerException(inner),
507 crate::types::error::ConverseStreamOutputError::ModelStreamErrorException(inner) => Error::ModelStreamErrorException(inner),
508 crate::types::error::ConverseStreamOutputError::ValidationException(inner) => Error::ValidationException(inner),
509 crate::types::error::ConverseStreamOutputError::ThrottlingException(inner) => Error::ThrottlingException(inner),
510 crate::types::error::ConverseStreamOutputError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
511 crate::types::error::ConverseStreamOutputError::Unhandled(inner) => Error::Unhandled(inner),
512 }
513 }
514}
515impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamInputError, R>> for Error
516where
517 R: Send + Sync + std::fmt::Debug + 'static,
518{
519 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamInputError, R>) -> Self {
520 match err {
521 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
522 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
523 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
524 source: err.into(),
525 }),
526 }
527 }
528}
529impl From<crate::types::error::InvokeModelWithBidirectionalStreamInputError> for Error {
530 fn from(err: crate::types::error::InvokeModelWithBidirectionalStreamInputError) -> Self {
531 match err {
532 crate::types::error::InvokeModelWithBidirectionalStreamInputError::Unhandled(inner) => Error::Unhandled(inner),
533 }
534 }
535}
536impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamOutputError, R>> for Error
537where
538 R: Send + Sync + std::fmt::Debug + 'static,
539{
540 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamOutputError, R>) -> Self {
541 match err {
542 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
543 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
544 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
545 source: err.into(),
546 }),
547 }
548 }
549}
550impl From<crate::types::error::InvokeModelWithBidirectionalStreamOutputError> for Error {
551 fn from(err: crate::types::error::InvokeModelWithBidirectionalStreamOutputError) -> Self {
552 match err {
553 crate::types::error::InvokeModelWithBidirectionalStreamOutputError::InternalServerException(inner) => {
554 Error::InternalServerException(inner)
555 }
556 crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ModelStreamErrorException(inner) => {
557 Error::ModelStreamErrorException(inner)
558 }
559 crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ValidationException(inner) => Error::ValidationException(inner),
560 crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ThrottlingException(inner) => Error::ThrottlingException(inner),
561 crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
562 crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ServiceUnavailableException(inner) => {
563 Error::ServiceUnavailableException(inner)
564 }
565 crate::types::error::InvokeModelWithBidirectionalStreamOutputError::Unhandled(inner) => Error::Unhandled(inner),
566 }
567 }
568}
569impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ResponseStreamError, R>> for Error
570where
571 R: Send + Sync + std::fmt::Debug + 'static,
572{
573 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ResponseStreamError, R>) -> Self {
574 match err {
575 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
576 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
577 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
578 source: err.into(),
579 }),
580 }
581 }
582}
583impl From<crate::types::error::ResponseStreamError> for Error {
584 fn from(err: crate::types::error::ResponseStreamError) -> Self {
585 match err {
586 crate::types::error::ResponseStreamError::InternalServerException(inner) => Error::InternalServerException(inner),
587 crate::types::error::ResponseStreamError::ModelStreamErrorException(inner) => Error::ModelStreamErrorException(inner),
588 crate::types::error::ResponseStreamError::ValidationException(inner) => Error::ValidationException(inner),
589 crate::types::error::ResponseStreamError::ThrottlingException(inner) => Error::ThrottlingException(inner),
590 crate::types::error::ResponseStreamError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
591 crate::types::error::ResponseStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
592 crate::types::error::ResponseStreamError::Unhandled(inner) => Error::Unhandled(inner),
593 }
594 }
595}
596impl ::std::error::Error for Error {
597 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
598 match self {
599 Error::AccessDeniedException(inner) => inner.source(),
600 Error::ConflictException(inner) => inner.source(),
601 Error::InternalServerException(inner) => inner.source(),
602 Error::ModelErrorException(inner) => inner.source(),
603 Error::ModelNotReadyException(inner) => inner.source(),
604 Error::ModelStreamErrorException(inner) => inner.source(),
605 Error::ModelTimeoutException(inner) => inner.source(),
606 Error::ResourceNotFoundException(inner) => inner.source(),
607 Error::ServiceQuotaExceededException(inner) => inner.source(),
608 Error::ServiceUnavailableException(inner) => inner.source(),
609 Error::ThrottlingException(inner) => inner.source(),
610 Error::ValidationException(inner) => inner.source(),
611 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
612 }
613 }
614}
615impl ::aws_types::request_id::RequestId for Error {
616 fn request_id(&self) -> Option<&str> {
617 match self {
618 Self::AccessDeniedException(e) => e.request_id(),
619 Self::ConflictException(e) => e.request_id(),
620 Self::InternalServerException(e) => e.request_id(),
621 Self::ModelErrorException(e) => e.request_id(),
622 Self::ModelNotReadyException(e) => e.request_id(),
623 Self::ModelStreamErrorException(e) => e.request_id(),
624 Self::ModelTimeoutException(e) => e.request_id(),
625 Self::ResourceNotFoundException(e) => e.request_id(),
626 Self::ServiceQuotaExceededException(e) => e.request_id(),
627 Self::ServiceUnavailableException(e) => e.request_id(),
628 Self::ThrottlingException(e) => e.request_id(),
629 Self::ValidationException(e) => e.request_id(),
630 Self::Unhandled(e) => e.meta.request_id(),
631 }
632 }
633}