1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | /// All possible error types for this service.
|
3 3 | #[non_exhaustive]
|
4 4 | #[derive(::std::fmt::Debug)]
|
5 5 | pub enum Error {
|
6 - | /// <p>The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied">AccessDeniedException</a> in the Amazon Bedrock User Guide</p>
|
6 + | /// <p>The request is denied because of missing access permissions.</p>
|
7 7 | AccessDeniedException(crate::types::error::AccessDeniedException),
|
8 - | /// <p>Error occurred because of a conflict while performing an operation.</p>
|
9 - | ConflictException(crate::types::error::ConflictException),
|
10 - | /// <p>An internal server error occurred. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure">InternalFailure</a> in the Amazon Bedrock User Guide</p>
|
8 + | /// <p>An internal server error occurred. Retry your request.</p>
|
11 9 | InternalServerException(crate::types::error::InternalServerException),
|
12 10 | /// <p>The request failed due to an error while processing the model.</p>
|
13 11 | ModelErrorException(crate::types::error::ModelErrorException),
|
14 - | /// <p>The model specified in the request is not ready to serve inference requests. The AWS SDK will automatically retry the operation up to 5 times. For information about configuring automatic retries, see <a href="https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html">Retry behavior</a> in the <i>AWS SDKs and Tools</i> reference guide.</p>
|
12 + | /// <p>The model specified in the request is not ready to serve inference requests.</p>
|
15 13 | ModelNotReadyException(crate::types::error::ModelNotReadyException),
|
16 14 | /// <p>An error occurred while streaming the response. Retry your request.</p>
|
17 15 | ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
|
18 16 | /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
|
19 17 | ModelTimeoutException(crate::types::error::ModelTimeoutException),
|
20 - | /// <p>The specified resource ARN was not found. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found">ResourceNotFound</a> in the Amazon Bedrock User Guide</p>
|
18 + | /// <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
|
21 19 | ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
|
22 - | /// <p>Your request exceeds the service quota for your account. You can view your quotas at <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html">Viewing service quotas</a>. You can resubmit your request later.</p>
|
20 + | /// <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
|
23 21 | ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
|
24 - | /// <p>The service isn't currently available. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable">ServiceUnavailable</a> in the Amazon Bedrock User Guide</p>
|
25 - | ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
|
26 - | /// <p>Your request was denied due to exceeding the account quotas for <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception">ThrottlingException</a> in the Amazon Bedrock User Guide</p>
|
22 + | /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
27 23 | ThrottlingException(crate::types::error::ThrottlingException),
|
28 - | /// <p>The input fails to satisfy the constraints specified by <i>Amazon Bedrock</i>. For troubleshooting this error, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error">ValidationError</a> in the Amazon Bedrock User Guide</p>
|
24 + | /// <p>Input validation failed. Check your request parameters and retry the request.</p>
|
29 25 | ValidationException(crate::types::error::ValidationException),
|
30 26 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
31 27 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
32 28 | variable wildcard pattern and check `.code()`:
|
33 29 | \
|
34 30 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
35 31 | \
|
36 32 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
|
37 33 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
38 34 | }
|
39 35 | impl ::std::fmt::Display for Error {
|
40 36 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
41 37 | match self {
|
42 38 | Error::AccessDeniedException(inner) => inner.fmt(f),
|
43 - | Error::ConflictException(inner) => inner.fmt(f),
|
44 39 | Error::InternalServerException(inner) => inner.fmt(f),
|
45 40 | Error::ModelErrorException(inner) => inner.fmt(f),
|
46 41 | Error::ModelNotReadyException(inner) => inner.fmt(f),
|
47 42 | Error::ModelStreamErrorException(inner) => inner.fmt(f),
|
48 43 | Error::ModelTimeoutException(inner) => inner.fmt(f),
|
49 44 | Error::ResourceNotFoundException(inner) => inner.fmt(f),
|
50 45 | Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
|
51 - | Error::ServiceUnavailableException(inner) => inner.fmt(f),
|
52 46 | Error::ThrottlingException(inner) => inner.fmt(f),
|
53 47 | Error::ValidationException(inner) => inner.fmt(f),
|
54 48 | Error::Unhandled(_) => {
|
55 49 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
56 50 | write!(f, "unhandled error ({code})")
|
57 51 | } else {
|
58 52 | f.write_str("unhandled error")
|
59 53 | }
|
60 54 | }
|
61 55 | }
|
62 56 | }
|
63 57 | }
|
64 58 | impl From<::aws_smithy_types::error::operation::BuildError> for Error {
|
65 59 | fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
|
66 60 | Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
67 61 | source: value.into(),
|
68 62 | meta: ::std::default::Default::default(),
|
69 63 | })
|
70 64 | }
|
71 65 | }
|
72 66 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
|
73 67 | fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
|
74 68 | match self {
|
75 69 | Self::AccessDeniedException(inner) => inner.meta(),
|
76 - | Self::ConflictException(inner) => inner.meta(),
|
77 70 | Self::InternalServerException(inner) => inner.meta(),
|
78 71 | Self::ModelErrorException(inner) => inner.meta(),
|
79 72 | Self::ModelNotReadyException(inner) => inner.meta(),
|
80 73 | Self::ModelStreamErrorException(inner) => inner.meta(),
|
81 74 | Self::ModelTimeoutException(inner) => inner.meta(),
|
82 75 | Self::ResourceNotFoundException(inner) => inner.meta(),
|
83 76 | Self::ServiceQuotaExceededException(inner) => inner.meta(),
|
84 - | Self::ServiceUnavailableException(inner) => inner.meta(),
|
85 77 | Self::ThrottlingException(inner) => inner.meta(),
|
86 78 | Self::ValidationException(inner) => inner.meta(),
|
87 79 | Self::Unhandled(inner) => &inner.meta,
|
88 80 | }
|
89 81 | }
|
90 82 | }
|
91 - | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::apply_guardrail::ApplyGuardrailError, R>> for Error
|
92 - | where
|
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 - | }
|
105 - | impl 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::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
115 - | crate::operation::apply_guardrail::ApplyGuardrailError::ValidationException(inner) => Error::ValidationException(inner),
|
116 - | crate::operation::apply_guardrail::ApplyGuardrailError::Unhandled(inner) => Error::Unhandled(inner),
|
117 - | }
|
118 - | }
|
119 - | }
|
120 83 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse::ConverseError, R>> for Error
|
121 84 | where
|
122 85 | R: Send + Sync + std::fmt::Debug + 'static,
|
123 86 | {
|
124 87 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse::ConverseError, R>) -> Self {
|
125 88 | match err {
|
126 89 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
127 90 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
128 91 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
129 92 | source: err.into(),
|
130 93 | }),
|
131 94 | }
|
132 95 | }
|
133 96 | }
|
134 97 | impl From<crate::operation::converse::ConverseError> for Error {
|
135 98 | fn from(err: crate::operation::converse::ConverseError) -> Self {
|
136 99 | match err {
|
137 100 | crate::operation::converse::ConverseError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
|
138 101 | crate::operation::converse::ConverseError::InternalServerException(inner) => Error::InternalServerException(inner),
|
139 102 | crate::operation::converse::ConverseError::ModelErrorException(inner) => Error::ModelErrorException(inner),
|
140 103 | crate::operation::converse::ConverseError::ModelNotReadyException(inner) => Error::ModelNotReadyException(inner),
|
141 104 | crate::operation::converse::ConverseError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
|
142 105 | crate::operation::converse::ConverseError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
|
143 - | crate::operation::converse::ConverseError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
|
144 106 | crate::operation::converse::ConverseError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
145 107 | crate::operation::converse::ConverseError::ValidationException(inner) => Error::ValidationException(inner),
|
146 108 | crate::operation::converse::ConverseError::Unhandled(inner) => Error::Unhandled(inner),
|
147 109 | }
|
148 110 | }
|
149 111 | }
|
150 112 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse_stream::ConverseStreamError, R>> for Error
|
151 113 | where
|
152 114 | R: Send + Sync + std::fmt::Debug + 'static,
|
153 115 | {
|
154 116 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::converse_stream::ConverseStreamError, R>) -> Self {
|
155 117 | match err {
|
156 118 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
157 119 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
158 120 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
159 121 | source: err.into(),
|
160 122 | }),
|
161 123 | }
|
162 124 | }
|
163 125 | }
|
164 126 | impl From<crate::operation::converse_stream::ConverseStreamError> for Error {
|
165 127 | fn from(err: crate::operation::converse_stream::ConverseStreamError) -> Self {
|
166 128 | match err {
|
167 129 | crate::operation::converse_stream::ConverseStreamError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
|
168 130 | crate::operation::converse_stream::ConverseStreamError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
|
169 131 | crate::operation::converse_stream::ConverseStreamError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
|
170 132 | crate::operation::converse_stream::ConverseStreamError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
171 - | crate::operation::converse_stream::ConverseStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
|
172 133 | crate::operation::converse_stream::ConverseStreamError::InternalServerException(inner) => Error::InternalServerException(inner),
|
173 134 | crate::operation::converse_stream::ConverseStreamError::ModelStreamErrorException(inner) => Error::ModelStreamErrorException(inner),
|
174 135 | crate::operation::converse_stream::ConverseStreamError::ValidationException(inner) => Error::ValidationException(inner),
|
175 136 | crate::operation::converse_stream::ConverseStreamError::ModelNotReadyException(inner) => Error::ModelNotReadyException(inner),
|
176 137 | crate::operation::converse_stream::ConverseStreamError::ModelErrorException(inner) => Error::ModelErrorException(inner),
|
177 138 | crate::operation::converse_stream::ConverseStreamError::Unhandled(inner) => Error::Unhandled(inner),
|
178 139 | }
|
179 140 | }
|
180 141 | }
|
181 - | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_async_invoke::GetAsyncInvokeError, R>> for Error
|
182 - | where
|
183 - | R: Send + Sync + std::fmt::Debug + 'static,
|
184 - | {
|
185 - | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_async_invoke::GetAsyncInvokeError, R>) -> Self {
|
186 - | match err {
|
187 - | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
188 - | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
189 - | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
190 - | source: err.into(),
|
191 - | }),
|
192 - | }
|
193 - | }
|
194 - | }
|
195 - | impl From<crate::operation::get_async_invoke::GetAsyncInvokeError> for Error {
|
196 - | fn from(err: crate::operation::get_async_invoke::GetAsyncInvokeError) -> Self {
|
197 - | match err {
|
198 - | crate::operation::get_async_invoke::GetAsyncInvokeError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
|
199 - | crate::operation::get_async_invoke::GetAsyncInvokeError::InternalServerException(inner) => Error::InternalServerException(inner),
|
200 - | crate::operation::get_async_invoke::GetAsyncInvokeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
201 - | crate::operation::get_async_invoke::GetAsyncInvokeError::ValidationException(inner) => Error::ValidationException(inner),
|
202 - | crate::operation::get_async_invoke::GetAsyncInvokeError::Unhandled(inner) => Error::Unhandled(inner),
|
203 - | }
|
204 - | }
|
205 - | }
|
206 142 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::invoke_model::InvokeModelError, R>> for Error
|
207 143 | where
|
208 144 | R: Send + Sync + std::fmt::Debug + 'static,
|
209 145 | {
|
210 146 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::invoke_model::InvokeModelError, R>) -> Self {
|
211 147 | match err {
|
212 148 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
213 149 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
214 150 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
215 151 | source: err.into(),
|
216 152 | }),
|
217 153 | }
|
218 154 | }
|
219 155 | }
|
220 156 | impl From<crate::operation::invoke_model::InvokeModelError> for Error {
|
221 157 | fn from(err: crate::operation::invoke_model::InvokeModelError) -> Self {
|
222 158 | match err {
|
223 159 | crate::operation::invoke_model::InvokeModelError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
|
224 160 | crate::operation::invoke_model::InvokeModelError::InternalServerException(inner) => Error::InternalServerException(inner),
|
225 161 | crate::operation::invoke_model::InvokeModelError::ModelErrorException(inner) => Error::ModelErrorException(inner),
|
226 162 | crate::operation::invoke_model::InvokeModelError::ModelNotReadyException(inner) => Error::ModelNotReadyException(inner),
|
227 163 | crate::operation::invoke_model::InvokeModelError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
|
228 164 | crate::operation::invoke_model::InvokeModelError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
|
229 165 | crate::operation::invoke_model::InvokeModelError::ServiceQuotaExceededException(inner) => Error::ServiceQuotaExceededException(inner),
|
230 - | crate::operation::invoke_model::InvokeModelError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
|
231 166 | crate::operation::invoke_model::InvokeModelError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
232 167 | crate::operation::invoke_model::InvokeModelError::ValidationException(inner) => Error::ValidationException(inner),
|
233 168 | crate::operation::invoke_model::InvokeModelError::Unhandled(inner) => Error::Unhandled(inner),
|
234 169 | }
|
235 170 | }
|
236 171 | }
|
237 - | impl<R>
|
238 - | From<
|
239 - | ::aws_smithy_runtime_api::client::result::SdkError<
|
240 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
|
241 - | R,
|
242 - | >,
|
243 - | > for Error
|
244 - | where
|
245 - | R: Send + Sync + std::fmt::Debug + 'static,
|
246 - | {
|
247 - | fn from(
|
248 - | err: ::aws_smithy_runtime_api::client::result::SdkError<
|
249 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError,
|
250 - | R,
|
251 - | >,
|
252 - | ) -> Self {
|
253 - | match err {
|
254 - | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
255 - | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
256 - | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
257 - | source: err.into(),
|
258 - | }),
|
259 - | }
|
260 - | }
|
261 - | }
|
262 - | impl From<crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError> for Error {
|
263 - | fn from(err: crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError) -> Self {
|
264 - | match err {
|
265 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelTimeoutException(inner) => {
|
266 - | Error::ModelTimeoutException(inner)
|
267 - | }
|
268 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::AccessDeniedException(inner) => {
|
269 - | Error::AccessDeniedException(inner)
|
270 - | }
|
271 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ResourceNotFoundException(inner) => {
|
272 - | Error::ResourceNotFoundException(inner)
|
273 - | }
|
274 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ThrottlingException(inner) => {
|
275 - | Error::ThrottlingException(inner)
|
276 - | }
|
277 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ServiceUnavailableException(inner) => {
|
278 - | Error::ServiceUnavailableException(inner)
|
279 - | }
|
280 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::InternalServerException(inner) => {
|
281 - | Error::InternalServerException(inner)
|
282 - | }
|
283 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelStreamErrorException(inner) => {
|
284 - | Error::ModelStreamErrorException(inner)
|
285 - | }
|
286 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ValidationException(inner) => {
|
287 - | Error::ValidationException(inner)
|
288 - | }
|
289 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelNotReadyException(inner) => {
|
290 - | Error::ModelNotReadyException(inner)
|
291 - | }
|
292 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ModelErrorException(inner) => {
|
293 - | Error::ModelErrorException(inner)
|
294 - | }
|
295 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::ServiceQuotaExceededException(
|
296 - | inner,
|
297 - | ) => Error::ServiceQuotaExceededException(inner),
|
298 - | crate::operation::invoke_model_with_bidirectional_stream::InvokeModelWithBidirectionalStreamError::Unhandled(inner) => {
|
299 - | Error::Unhandled(inner)
|
300 - | }
|
301 - | }
|
302 - | }
|
303 - | }
|
304 172 | impl<R>
|
305 173 | From<
|
306 174 | ::aws_smithy_runtime_api::client::result::SdkError<
|
307 175 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError,
|
308 176 | R,
|
309 177 | >,
|
310 178 | > for Error
|
311 179 | where
|
312 180 | R: Send + Sync + std::fmt::Debug + 'static,
|
313 181 | {
|
314 182 | fn from(
|
315 183 | err: ::aws_smithy_runtime_api::client::result::SdkError<
|
316 184 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError,
|
317 185 | R,
|
318 186 | >,
|
319 187 | ) -> Self {
|
320 188 | match err {
|
321 189 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
322 190 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
323 191 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
324 192 | source: err.into(),
|
325 193 | }),
|
326 194 | }
|
327 195 | }
|
328 196 | }
|
329 197 | impl From<crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError> for Error {
|
330 198 | fn from(err: crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError) -> Self {
|
331 199 | match err {
|
332 200 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelTimeoutException(inner) => {
|
333 201 | Error::ModelTimeoutException(inner)
|
334 202 | }
|
335 203 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::AccessDeniedException(inner) => {
|
336 204 | Error::AccessDeniedException(inner)
|
337 205 | }
|
338 206 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ResourceNotFoundException(inner) => {
|
339 207 | Error::ResourceNotFoundException(inner)
|
340 208 | }
|
341 209 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ThrottlingException(inner) => {
|
342 210 | Error::ThrottlingException(inner)
|
343 211 | }
|
344 - | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ServiceUnavailableException(inner) => {
|
345 - | Error::ServiceUnavailableException(inner)
|
346 - | }
|
347 212 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::InternalServerException(inner) => {
|
348 213 | Error::InternalServerException(inner)
|
349 214 | }
|
350 215 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelStreamErrorException(inner) => {
|
351 216 | Error::ModelStreamErrorException(inner)
|
352 217 | }
|
353 218 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ValidationException(inner) => {
|
354 219 | Error::ValidationException(inner)
|
355 220 | }
|
356 221 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelNotReadyException(inner) => {
|
357 222 | Error::ModelNotReadyException(inner)
|
358 223 | }
|
359 224 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ModelErrorException(inner) => {
|
360 225 | Error::ModelErrorException(inner)
|
361 226 | }
|
362 227 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::ServiceQuotaExceededException(inner) => {
|
363 228 | Error::ServiceQuotaExceededException(inner)
|
364 229 | }
|
365 230 | crate::operation::invoke_model_with_response_stream::InvokeModelWithResponseStreamError::Unhandled(inner) => Error::Unhandled(inner),
|
366 231 | }
|
367 232 | }
|
368 233 | }
|
369 - | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_async_invokes::ListAsyncInvokesError, R>> for Error
|
370 - | where
|
371 - | R: Send + Sync + std::fmt::Debug + 'static,
|
372 - | {
|
373 - | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_async_invokes::ListAsyncInvokesError, R>) -> Self {
|
374 - | match err {
|
375 - | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
376 - | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
377 - | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
378 - | source: err.into(),
|
379 - | }),
|
380 - | }
|
381 - | }
|
382 - | }
|
383 - | impl From<crate::operation::list_async_invokes::ListAsyncInvokesError> for Error {
|
384 - | fn from(err: crate::operation::list_async_invokes::ListAsyncInvokesError) -> Self {
|
385 - | match err {
|
386 - | crate::operation::list_async_invokes::ListAsyncInvokesError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
|
387 - | crate::operation::list_async_invokes::ListAsyncInvokesError::InternalServerException(inner) => Error::InternalServerException(inner),
|
388 - | crate::operation::list_async_invokes::ListAsyncInvokesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
389 - | crate::operation::list_async_invokes::ListAsyncInvokesError::ValidationException(inner) => Error::ValidationException(inner),
|
390 - | crate::operation::list_async_invokes::ListAsyncInvokesError::Unhandled(inner) => Error::Unhandled(inner),
|
391 - | }
|
392 - | }
|
393 - | }
|
394 - | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_async_invoke::StartAsyncInvokeError, R>> for Error
|
395 - | where
|
396 - | R: Send + Sync + std::fmt::Debug + 'static,
|
397 - | {
|
398 - | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_async_invoke::StartAsyncInvokeError, R>) -> Self {
|
399 - | match err {
|
400 - | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
401 - | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
402 - | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
403 - | source: err.into(),
|
404 - | }),
|
405 - | }
|
406 - | }
|
407 - | }
|
408 - | impl From<crate::operation::start_async_invoke::StartAsyncInvokeError> for Error {
|
409 - | fn from(err: crate::operation::start_async_invoke::StartAsyncInvokeError) -> Self {
|
410 - | match err {
|
411 - | crate::operation::start_async_invoke::StartAsyncInvokeError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
|
412 - | crate::operation::start_async_invoke::StartAsyncInvokeError::ConflictException(inner) => Error::ConflictException(inner),
|
413 - | crate::operation::start_async_invoke::StartAsyncInvokeError::InternalServerException(inner) => Error::InternalServerException(inner),
|
414 - | crate::operation::start_async_invoke::StartAsyncInvokeError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
|
415 - | crate::operation::start_async_invoke::StartAsyncInvokeError::ServiceQuotaExceededException(inner) => {
|
416 - | Error::ServiceQuotaExceededException(inner)
|
417 - | }
|
418 - | crate::operation::start_async_invoke::StartAsyncInvokeError::ServiceUnavailableException(inner) => {
|
419 - | Error::ServiceUnavailableException(inner)
|
420 - | }
|
421 - | crate::operation::start_async_invoke::StartAsyncInvokeError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
422 - | crate::operation::start_async_invoke::StartAsyncInvokeError::ValidationException(inner) => Error::ValidationException(inner),
|
423 - | crate::operation::start_async_invoke::StartAsyncInvokeError::Unhandled(inner) => Error::Unhandled(inner),
|
424 - | }
|
425 - | }
|
426 - | }
|
427 234 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ConverseStreamOutputError, R>> for Error
|
428 235 | where
|
429 236 | R: Send + Sync + std::fmt::Debug + 'static,
|
430 237 | {
|
431 238 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ConverseStreamOutputError, R>) -> Self {
|
432 239 | match err {
|
433 240 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
434 241 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
435 242 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
436 243 | source: err.into(),
|
437 244 | }),
|
438 245 | }
|
439 246 | }
|
440 247 | }
|
441 248 | impl From<crate::types::error::ConverseStreamOutputError> for Error {
|
442 249 | fn from(err: crate::types::error::ConverseStreamOutputError) -> Self {
|
443 250 | match err {
|
444 251 | crate::types::error::ConverseStreamOutputError::InternalServerException(inner) => Error::InternalServerException(inner),
|
445 252 | crate::types::error::ConverseStreamOutputError::ModelStreamErrorException(inner) => Error::ModelStreamErrorException(inner),
|
446 253 | crate::types::error::ConverseStreamOutputError::ValidationException(inner) => Error::ValidationException(inner),
|
447 254 | crate::types::error::ConverseStreamOutputError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
448 - | crate::types::error::ConverseStreamOutputError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
|
449 255 | crate::types::error::ConverseStreamOutputError::Unhandled(inner) => Error::Unhandled(inner),
|
450 256 | }
|
451 257 | }
|
452 258 | }
|
453 - | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamInputError, R>> for Error
|
454 - | where
|
455 - | R: Send + Sync + std::fmt::Debug + 'static,
|
456 - | {
|
457 - | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamInputError, R>) -> Self {
|
458 - | match err {
|
459 - | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
460 - | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
461 - | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
462 - | source: err.into(),
|
463 - | }),
|
464 - | }
|
465 - | }
|
466 - | }
|
467 - | impl From<crate::types::error::InvokeModelWithBidirectionalStreamInputError> for Error {
|
468 - | fn from(err: crate::types::error::InvokeModelWithBidirectionalStreamInputError) -> Self {
|
469 - | match err {
|
470 - | crate::types::error::InvokeModelWithBidirectionalStreamInputError::Unhandled(inner) => Error::Unhandled(inner),
|
471 - | }
|
472 - | }
|
473 - | }
|
474 - | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamOutputError, R>> for Error
|
475 - | where
|
476 - | R: Send + Sync + std::fmt::Debug + 'static,
|
477 - | {
|
478 - | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::InvokeModelWithBidirectionalStreamOutputError, R>) -> Self {
|
479 - | match err {
|
480 - | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
481 - | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
482 - | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
483 - | source: err.into(),
|
484 - | }),
|
485 - | }
|
486 - | }
|
487 - | }
|
488 - | impl From<crate::types::error::InvokeModelWithBidirectionalStreamOutputError> for Error {
|
489 - | fn from(err: crate::types::error::InvokeModelWithBidirectionalStreamOutputError) -> Self {
|
490 - | match err {
|
491 - | crate::types::error::InvokeModelWithBidirectionalStreamOutputError::InternalServerException(inner) => {
|
492 - | Error::InternalServerException(inner)
|
493 - | }
|
494 - | crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ModelStreamErrorException(inner) => {
|
495 - | Error::ModelStreamErrorException(inner)
|
496 - | }
|
497 - | crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ValidationException(inner) => Error::ValidationException(inner),
|
498 - | crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
499 - | crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
|
500 - | crate::types::error::InvokeModelWithBidirectionalStreamOutputError::ServiceUnavailableException(inner) => {
|
501 - | Error::ServiceUnavailableException(inner)
|
502 - | }
|
503 - | crate::types::error::InvokeModelWithBidirectionalStreamOutputError::Unhandled(inner) => Error::Unhandled(inner),
|
504 - | }
|
505 - | }
|
506 - | }
|
507 259 | impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ResponseStreamError, R>> for Error
|
508 260 | where
|
509 261 | R: Send + Sync + std::fmt::Debug + 'static,
|
510 262 | {
|
511 263 | fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::ResponseStreamError, R>) -> Self {
|
512 264 | match err {
|
513 265 | ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
|
514 266 | _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
515 267 | meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
|
516 268 | source: err.into(),
|
517 269 | }),
|
518 270 | }
|
519 271 | }
|
520 272 | }
|
521 273 | impl From<crate::types::error::ResponseStreamError> for Error {
|
522 274 | fn from(err: crate::types::error::ResponseStreamError) -> Self {
|
523 275 | match err {
|
524 276 | crate::types::error::ResponseStreamError::InternalServerException(inner) => Error::InternalServerException(inner),
|
525 277 | crate::types::error::ResponseStreamError::ModelStreamErrorException(inner) => Error::ModelStreamErrorException(inner),
|
526 278 | crate::types::error::ResponseStreamError::ValidationException(inner) => Error::ValidationException(inner),
|
527 279 | crate::types::error::ResponseStreamError::ThrottlingException(inner) => Error::ThrottlingException(inner),
|
528 280 | crate::types::error::ResponseStreamError::ModelTimeoutException(inner) => Error::ModelTimeoutException(inner),
|
529 - | crate::types::error::ResponseStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
|
530 281 | crate::types::error::ResponseStreamError::Unhandled(inner) => Error::Unhandled(inner),
|
531 282 | }
|
532 283 | }
|
533 284 | }
|
534 285 | impl ::std::error::Error for Error {
|
535 286 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
536 287 | match self {
|
537 288 | Error::AccessDeniedException(inner) => inner.source(),
|
538 - | Error::ConflictException(inner) => inner.source(),
|
539 289 | Error::InternalServerException(inner) => inner.source(),
|
540 290 | Error::ModelErrorException(inner) => inner.source(),
|
541 291 | Error::ModelNotReadyException(inner) => inner.source(),
|
542 292 | Error::ModelStreamErrorException(inner) => inner.source(),
|
543 293 | Error::ModelTimeoutException(inner) => inner.source(),
|
544 294 | Error::ResourceNotFoundException(inner) => inner.source(),
|
545 295 | Error::ServiceQuotaExceededException(inner) => inner.source(),
|
546 - | Error::ServiceUnavailableException(inner) => inner.source(),
|
547 296 | Error::ThrottlingException(inner) => inner.source(),
|
548 297 | Error::ValidationException(inner) => inner.source(),
|
549 298 | Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
|
550 299 | }
|
551 300 | }
|
552 301 | }
|
553 302 | impl ::aws_types::request_id::RequestId for Error {
|
554 303 | fn request_id(&self) -> Option<&str> {
|
555 304 | match self {
|
556 305 | Self::AccessDeniedException(e) => e.request_id(),
|
557 - | Self::ConflictException(e) => e.request_id(),
|
558 306 | Self::InternalServerException(e) => e.request_id(),
|
559 307 | Self::ModelErrorException(e) => e.request_id(),
|
560 308 | Self::ModelNotReadyException(e) => e.request_id(),
|
561 309 | Self::ModelStreamErrorException(e) => e.request_id(),
|
562 310 | Self::ModelTimeoutException(e) => e.request_id(),
|
563 311 | Self::ResourceNotFoundException(e) => e.request_id(),
|
564 312 | Self::ServiceQuotaExceededException(e) => e.request_id(),
|
565 - | Self::ServiceUnavailableException(e) => e.request_id(),
|
566 313 | Self::ThrottlingException(e) => e.request_id(),
|
567 314 | Self::ValidationException(e) => e.request_id(),
|
568 315 | Self::Unhandled(e) => e.meta.request_id(),
|
569 316 | }
|
570 317 | }
|
571 318 | }
|