4 4 | pub use crate::types::error::_model_error_exception::ModelErrorException;
|
5 5 |
|
6 6 | pub use crate::types::error::_model_not_ready_exception::ModelNotReadyException;
|
7 7 |
|
8 8 | pub use crate::types::error::_validation_exception::ValidationException;
|
9 9 |
|
10 10 | pub use crate::types::error::_model_stream_error_exception::ModelStreamErrorException;
|
11 11 |
|
12 12 | pub use crate::types::error::_internal_server_exception::InternalServerException;
|
13 13 |
|
14 - | pub use crate::types::error::_service_unavailable_exception::ServiceUnavailableException;
|
15 - |
|
16 14 | pub use crate::types::error::_throttling_exception::ThrottlingException;
|
17 15 |
|
18 16 | pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundException;
|
19 17 |
|
20 18 | pub use crate::types::error::_access_denied_exception::AccessDeniedException;
|
21 19 |
|
22 20 | pub use crate::types::error::_model_timeout_exception::ModelTimeoutException;
|
23 21 |
|
24 22 | /// Error type for the `ResponseStreamError` operation.
|
25 23 | #[non_exhaustive]
|
26 24 | #[derive(::std::fmt::Debug)]
|
27 25 | pub enum ResponseStreamError {
|
28 - | /// <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>
|
26 + | /// <p>An internal server error occurred. Retry your request.</p>
|
29 27 | InternalServerException(crate::types::error::InternalServerException),
|
30 28 | /// <p>An error occurred while streaming the response. Retry your request.</p>
|
31 29 | ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
|
32 - | /// <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>
|
30 + | /// <p>Input validation failed. Check your request parameters and retry the request.</p>
|
33 31 | ValidationException(crate::types::error::ValidationException),
|
34 - | /// <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>
|
32 + | /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
35 33 | ThrottlingException(crate::types::error::ThrottlingException),
|
36 34 | /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
|
37 35 | ModelTimeoutException(crate::types::error::ModelTimeoutException),
|
38 - | /// <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>
|
39 - | ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
|
40 36 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
41 37 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
42 38 | variable wildcard pattern and check `.code()`:
|
43 39 | \
|
44 40 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
45 41 | \
|
46 42 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseStreamError) for what information is available for the error.")]
|
47 43 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
48 44 | }
|
49 45 | impl ResponseStreamError {
|
50 46 | /// Creates the `ResponseStreamError::Unhandled` variant from any error type.
|
51 47 | pub fn unhandled(
|
52 48 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
53 49 | ) -> Self {
|
54 50 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
55 51 | source: err.into(),
|
56 52 | meta: ::std::default::Default::default(),
|
57 53 | })
|
58 54 | }
|
59 55 |
|
60 56 | /// Creates the `ResponseStreamError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
61 57 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
62 58 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
63 59 | source: err.clone().into(),
|
64 60 | meta: err,
|
65 61 | })
|
66 62 | }
|
67 63 | ///
|
68 64 | /// Returns error metadata, which includes the error code, message,
|
69 65 | /// request ID, and potentially additional information.
|
70 66 | ///
|
71 67 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
72 68 | match self {
|
73 69 | Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
74 70 | Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
75 71 | Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
76 72 | Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
77 73 | Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
78 - | Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
79 74 | Self::Unhandled(e) => &e.meta,
|
80 75 | }
|
81 76 | }
|
82 77 | /// Returns `true` if the error kind is `ResponseStreamError::InternalServerException`.
|
83 78 | pub fn is_internal_server_exception(&self) -> bool {
|
84 79 | matches!(self, Self::InternalServerException(_))
|
85 80 | }
|
86 81 | /// Returns `true` if the error kind is `ResponseStreamError::ModelStreamErrorException`.
|
87 82 | pub fn is_model_stream_error_exception(&self) -> bool {
|
88 83 | matches!(self, Self::ModelStreamErrorException(_))
|
89 84 | }
|
90 85 | /// Returns `true` if the error kind is `ResponseStreamError::ValidationException`.
|
91 86 | pub fn is_validation_exception(&self) -> bool {
|
92 87 | matches!(self, Self::ValidationException(_))
|
93 88 | }
|
94 89 | /// Returns `true` if the error kind is `ResponseStreamError::ThrottlingException`.
|
95 90 | pub fn is_throttling_exception(&self) -> bool {
|
96 91 | matches!(self, Self::ThrottlingException(_))
|
97 92 | }
|
98 93 | /// Returns `true` if the error kind is `ResponseStreamError::ModelTimeoutException`.
|
99 94 | pub fn is_model_timeout_exception(&self) -> bool {
|
100 95 | matches!(self, Self::ModelTimeoutException(_))
|
101 96 | }
|
102 - | /// Returns `true` if the error kind is `ResponseStreamError::ServiceUnavailableException`.
|
103 - | pub fn is_service_unavailable_exception(&self) -> bool {
|
104 - | matches!(self, Self::ServiceUnavailableException(_))
|
105 - | }
|
106 97 | }
|
107 98 | impl ::std::error::Error for ResponseStreamError {
|
108 99 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
109 100 | match self {
|
110 101 | Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
|
111 102 | Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
|
112 103 | Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
|
113 104 | Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
|
114 105 | Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
|
115 - | Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
|
116 106 | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
117 107 | }
|
118 108 | }
|
119 109 | }
|
120 110 | impl ::std::fmt::Display for ResponseStreamError {
|
121 111 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
122 112 | match self {
|
123 113 | Self::InternalServerException(_inner) => _inner.fmt(f),
|
124 114 | Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
|
125 115 | Self::ValidationException(_inner) => _inner.fmt(f),
|
126 116 | Self::ThrottlingException(_inner) => _inner.fmt(f),
|
127 117 | Self::ModelTimeoutException(_inner) => _inner.fmt(f),
|
128 - | Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
|
129 118 | Self::Unhandled(_inner) => {
|
130 119 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
131 120 | write!(f, "unhandled error ({code})")
|
132 121 | } else {
|
133 122 | f.write_str("unhandled error")
|
134 123 | }
|
135 124 | }
|
136 125 | }
|
137 126 | }
|
138 127 | }
|
139 128 | impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseStreamError {
|
140 129 | fn code(&self) -> ::std::option::Option<&str> {
|
141 130 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
142 131 | }
|
143 132 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
144 133 | ::std::option::Option::None
|
145 134 | }
|
146 135 | }
|
147 136 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseStreamError {
|
148 137 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
149 138 | match self {
|
150 139 | Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
151 140 | Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
152 141 | Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
153 142 | Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
154 143 | Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
155 - | Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
156 144 | Self::Unhandled(_inner) => &_inner.meta,
|
157 145 | }
|
158 146 | }
|
159 147 | }
|
160 148 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseStreamError {
|
161 149 | fn create_unhandled_error(
|
162 150 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
163 151 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
164 152 | ) -> Self {
|
165 153 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
166 154 | source,
|
167 155 | meta: meta.unwrap_or_default(),
|
168 156 | })
|
169 157 | }
|
170 158 | }
|
171 159 | impl ::aws_types::request_id::RequestId for crate::types::error::ResponseStreamError {
|
172 160 | fn request_id(&self) -> Option<&str> {
|
173 161 | self.meta().request_id()
|
174 162 | }
|
175 163 | }
|
176 164 |
|
177 - | /// Error type for the `InvokeModelWithBidirectionalStreamOutputError` operation.
|
178 - | #[non_exhaustive]
|
179 - | #[derive(::std::fmt::Debug)]
|
180 - | pub enum InvokeModelWithBidirectionalStreamOutputError {
|
181 - | /// <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>
|
182 - | InternalServerException(crate::types::error::InternalServerException),
|
183 - | /// <p>An error occurred while streaming the response. Retry your request.</p>
|
184 - | ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
|
185 - | /// <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>
|
186 - | ValidationException(crate::types::error::ValidationException),
|
187 - | /// <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>
|
188 - | ThrottlingException(crate::types::error::ThrottlingException),
|
189 - | /// <p>The request took too long to process. Processing time exceeded the model timeout length.</p>
|
190 - | ModelTimeoutException(crate::types::error::ModelTimeoutException),
|
191 - | /// <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>
|
192 - | ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
|
193 - | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
194 - | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
195 - | variable wildcard pattern and check `.code()`:
|
196 - | \
|
197 - | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
198 - | \
|
199 - | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithBidirectionalStreamOutputError) for what information is available for the error.")]
|
200 - | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
201 - | }
|
202 - | impl InvokeModelWithBidirectionalStreamOutputError {
|
203 - | /// Creates the `InvokeModelWithBidirectionalStreamOutputError::Unhandled` variant from any error type.
|
204 - | pub fn unhandled(
|
205 - | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
206 - | ) -> Self {
|
207 - | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
208 - | source: err.into(),
|
209 - | meta: ::std::default::Default::default(),
|
210 - | })
|
211 - | }
|
212 - |
|
213 - | /// Creates the `InvokeModelWithBidirectionalStreamOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
214 - | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
215 - | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
216 - | source: err.clone().into(),
|
217 - | meta: err,
|
218 - | })
|
219 - | }
|
220 - | ///
|
221 - | /// Returns error metadata, which includes the error code, message,
|
222 - | /// request ID, and potentially additional information.
|
223 - | ///
|
224 - | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
225 - | match self {
|
226 - | Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
227 - | Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
228 - | Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
229 - | Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
230 - | Self::ModelTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
231 - | Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
232 - | Self::Unhandled(e) => &e.meta,
|
233 - | }
|
234 - | }
|
235 - | /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::InternalServerException`.
|
236 - | pub fn is_internal_server_exception(&self) -> bool {
|
237 - | matches!(self, Self::InternalServerException(_))
|
238 - | }
|
239 - | /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ModelStreamErrorException`.
|
240 - | pub fn is_model_stream_error_exception(&self) -> bool {
|
241 - | matches!(self, Self::ModelStreamErrorException(_))
|
242 - | }
|
243 - | /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ValidationException`.
|
244 - | pub fn is_validation_exception(&self) -> bool {
|
245 - | matches!(self, Self::ValidationException(_))
|
246 - | }
|
247 - | /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ThrottlingException`.
|
248 - | pub fn is_throttling_exception(&self) -> bool {
|
249 - | matches!(self, Self::ThrottlingException(_))
|
250 - | }
|
251 - | /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ModelTimeoutException`.
|
252 - | pub fn is_model_timeout_exception(&self) -> bool {
|
253 - | matches!(self, Self::ModelTimeoutException(_))
|
254 - | }
|
255 - | /// Returns `true` if the error kind is `InvokeModelWithBidirectionalStreamOutputError::ServiceUnavailableException`.
|
256 - | pub fn is_service_unavailable_exception(&self) -> bool {
|
257 - | matches!(self, Self::ServiceUnavailableException(_))
|
258 - | }
|
259 - | }
|
260 - | impl ::std::error::Error for InvokeModelWithBidirectionalStreamOutputError {
|
261 - | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
262 - | match self {
|
263 - | Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
|
264 - | Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
|
265 - | Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
|
266 - | Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
|
267 - | Self::ModelTimeoutException(_inner) => ::std::option::Option::Some(_inner),
|
268 - | Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
|
269 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
270 - | }
|
271 - | }
|
272 - | }
|
273 - | impl ::std::fmt::Display for InvokeModelWithBidirectionalStreamOutputError {
|
274 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
275 - | match self {
|
276 - | Self::InternalServerException(_inner) => _inner.fmt(f),
|
277 - | Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
|
278 - | Self::ValidationException(_inner) => _inner.fmt(f),
|
279 - | Self::ThrottlingException(_inner) => _inner.fmt(f),
|
280 - | Self::ModelTimeoutException(_inner) => _inner.fmt(f),
|
281 - | Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
|
282 - | Self::Unhandled(_inner) => {
|
283 - | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
284 - | write!(f, "unhandled error ({code})")
|
285 - | } else {
|
286 - | f.write_str("unhandled error")
|
287 - | }
|
288 - | }
|
289 - | }
|
290 - | }
|
291 - | }
|
292 - | impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithBidirectionalStreamOutputError {
|
293 - | fn code(&self) -> ::std::option::Option<&str> {
|
294 - | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
295 - | }
|
296 - | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
297 - | ::std::option::Option::None
|
298 - | }
|
299 - | }
|
300 - | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithBidirectionalStreamOutputError {
|
301 - | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
302 - | match self {
|
303 - | Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
304 - | Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
305 - | Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
306 - | Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
307 - | Self::ModelTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
308 - | Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
309 - | Self::Unhandled(_inner) => &_inner.meta,
|
310 - | }
|
311 - | }
|
312 - | }
|
313 - | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelWithBidirectionalStreamOutputError {
|
314 - | fn create_unhandled_error(
|
315 - | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
316 - | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
317 - | ) -> Self {
|
318 - | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
319 - | source,
|
320 - | meta: meta.unwrap_or_default(),
|
321 - | })
|
322 - | }
|
323 - | }
|
324 - | impl ::aws_types::request_id::RequestId for crate::types::error::InvokeModelWithBidirectionalStreamOutputError {
|
325 - | fn request_id(&self) -> Option<&str> {
|
326 - | self.meta().request_id()
|
327 - | }
|
328 - | }
|
329 - |
|
330 - | /// Error type for the `InvokeModelWithBidirectionalStreamInputError` operation.
|
331 - | #[non_exhaustive]
|
332 - | #[derive(::std::fmt::Debug)]
|
333 - | pub enum InvokeModelWithBidirectionalStreamInputError {
|
334 - | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
335 - | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
336 - | variable wildcard pattern and check `.code()`:
|
337 - | \
|
338 - | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
339 - | \
|
340 - | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-InvokeModelWithBidirectionalStreamInputError) for what information is available for the error.")]
|
341 - | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
342 - | }
|
343 - | impl InvokeModelWithBidirectionalStreamInputError {
|
344 - | /// Creates the `InvokeModelWithBidirectionalStreamInputError::Unhandled` variant from any error type.
|
345 - | pub fn unhandled(
|
346 - | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
347 - | ) -> Self {
|
348 - | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
349 - | source: err.into(),
|
350 - | meta: ::std::default::Default::default(),
|
351 - | })
|
352 - | }
|
353 - |
|
354 - | /// Creates the `InvokeModelWithBidirectionalStreamInputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
355 - | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
356 - | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
357 - | source: err.clone().into(),
|
358 - | meta: err,
|
359 - | })
|
360 - | }
|
361 - | ///
|
362 - | /// Returns error metadata, which includes the error code, message,
|
363 - | /// request ID, and potentially additional information.
|
364 - | ///
|
365 - | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
366 - | match self {
|
367 - | Self::Unhandled(e) => &e.meta,
|
368 - | }
|
369 - | }
|
370 - | }
|
371 - | impl ::std::error::Error for InvokeModelWithBidirectionalStreamInputError {
|
372 - | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
373 - | match self {
|
374 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
375 - | }
|
376 - | }
|
377 - | }
|
378 - | impl ::std::fmt::Display for InvokeModelWithBidirectionalStreamInputError {
|
379 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
380 - | match self {
|
381 - | Self::Unhandled(_inner) => {
|
382 - | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
383 - | write!(f, "unhandled error ({code})")
|
384 - | } else {
|
385 - | f.write_str("unhandled error")
|
386 - | }
|
387 - | }
|
388 - | }
|
389 - | }
|
390 - | }
|
391 - | impl ::aws_smithy_types::retry::ProvideErrorKind for InvokeModelWithBidirectionalStreamInputError {
|
392 - | fn code(&self) -> ::std::option::Option<&str> {
|
393 - | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
394 - | }
|
395 - | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
396 - | ::std::option::Option::None
|
397 - | }
|
398 - | }
|
399 - | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvokeModelWithBidirectionalStreamInputError {
|
400 - | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
401 - | match self {
|
402 - | Self::Unhandled(_inner) => &_inner.meta,
|
403 - | }
|
404 - | }
|
405 - | }
|
406 - | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for InvokeModelWithBidirectionalStreamInputError {
|
407 - | fn create_unhandled_error(
|
408 - | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
409 - | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
410 - | ) -> Self {
|
411 - | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
412 - | source,
|
413 - | meta: meta.unwrap_or_default(),
|
414 - | })
|
415 - | }
|
416 - | }
|
417 - | impl ::aws_types::request_id::RequestId for crate::types::error::InvokeModelWithBidirectionalStreamInputError {
|
418 - | fn request_id(&self) -> Option<&str> {
|
419 - | self.meta().request_id()
|
420 - | }
|
421 - | }
|
422 - |
|
423 165 | /// Error type for the `ConverseStreamOutputError` operation.
|
424 166 | #[non_exhaustive]
|
425 167 | #[derive(::std::fmt::Debug)]
|
426 168 | pub enum ConverseStreamOutputError {
|
427 - | /// <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>
|
169 + | /// <p>An internal server error occurred. Retry your request.</p>
|
428 170 | InternalServerException(crate::types::error::InternalServerException),
|
429 171 | /// <p>An error occurred while streaming the response. Retry your request.</p>
|
430 172 | ModelStreamErrorException(crate::types::error::ModelStreamErrorException),
|
431 - | /// <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>
|
173 + | /// <p>Input validation failed. Check your request parameters and retry the request.</p>
|
432 174 | ValidationException(crate::types::error::ValidationException),
|
433 - | /// <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>
|
175 + | /// <p>The number of requests exceeds the limit. Resubmit your request later.</p>
|
434 176 | ThrottlingException(crate::types::error::ThrottlingException),
|
435 - | /// <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>
|
436 - | ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
|
437 177 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
438 178 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
439 179 | variable wildcard pattern and check `.code()`:
|
440 180 | \
|
441 181 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
442 182 | \
|
443 183 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ConverseStreamOutputError) for what information is available for the error.")]
|
444 184 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
445 185 | }
|
446 186 | impl ConverseStreamOutputError {
|
447 187 | /// Creates the `ConverseStreamOutputError::Unhandled` variant from any error type.
|
448 188 | pub fn unhandled(
|
449 189 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
450 190 | ) -> Self {
|
451 191 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
452 192 | source: err.into(),
|
453 193 | meta: ::std::default::Default::default(),
|
454 194 | })
|
455 195 | }
|
456 196 |
|
457 197 | /// Creates the `ConverseStreamOutputError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
458 198 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
459 199 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
460 200 | source: err.clone().into(),
|
461 201 | meta: err,
|
462 202 | })
|
463 203 | }
|
464 204 | ///
|
465 205 | /// Returns error metadata, which includes the error code, message,
|
466 206 | /// request ID, and potentially additional information.
|
467 207 | ///
|
468 208 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
469 209 | match self {
|
470 210 | Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
471 211 | Self::ModelStreamErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
472 212 | Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
473 213 | Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
474 - | Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
475 214 | Self::Unhandled(e) => &e.meta,
|
476 215 | }
|
477 216 | }
|
478 217 | /// Returns `true` if the error kind is `ConverseStreamOutputError::InternalServerException`.
|
479 218 | pub fn is_internal_server_exception(&self) -> bool {
|
480 219 | matches!(self, Self::InternalServerException(_))
|
481 220 | }
|
482 221 | /// Returns `true` if the error kind is `ConverseStreamOutputError::ModelStreamErrorException`.
|
483 222 | pub fn is_model_stream_error_exception(&self) -> bool {
|
484 223 | matches!(self, Self::ModelStreamErrorException(_))
|
485 224 | }
|
486 225 | /// Returns `true` if the error kind is `ConverseStreamOutputError::ValidationException`.
|
487 226 | pub fn is_validation_exception(&self) -> bool {
|
488 227 | matches!(self, Self::ValidationException(_))
|
489 228 | }
|
490 229 | /// Returns `true` if the error kind is `ConverseStreamOutputError::ThrottlingException`.
|
491 230 | pub fn is_throttling_exception(&self) -> bool {
|
492 231 | matches!(self, Self::ThrottlingException(_))
|
493 232 | }
|
494 - | /// Returns `true` if the error kind is `ConverseStreamOutputError::ServiceUnavailableException`.
|
495 - | pub fn is_service_unavailable_exception(&self) -> bool {
|
496 - | matches!(self, Self::ServiceUnavailableException(_))
|
497 - | }
|
498 233 | }
|
499 234 | impl ::std::error::Error for ConverseStreamOutputError {
|
500 235 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
501 236 | match self {
|
502 237 | Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
|
503 238 | Self::ModelStreamErrorException(_inner) => ::std::option::Option::Some(_inner),
|
504 239 | Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
|
505 240 | Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
|
506 - | Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner),
|
507 241 | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
508 242 | }
|
509 243 | }
|
510 244 | }
|
511 245 | impl ::std::fmt::Display for ConverseStreamOutputError {
|
512 246 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
513 247 | match self {
|
514 248 | Self::InternalServerException(_inner) => _inner.fmt(f),
|
515 249 | Self::ModelStreamErrorException(_inner) => _inner.fmt(f),
|
516 250 | Self::ValidationException(_inner) => _inner.fmt(f),
|
517 251 | Self::ThrottlingException(_inner) => _inner.fmt(f),
|
518 - | Self::ServiceUnavailableException(_inner) => _inner.fmt(f),
|
519 252 | Self::Unhandled(_inner) => {
|
520 253 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
521 254 | write!(f, "unhandled error ({code})")
|
522 255 | } else {
|
523 256 | f.write_str("unhandled error")
|
524 257 | }
|
525 258 | }
|
526 259 | }
|
527 260 | }
|
528 261 | }
|
529 262 | impl ::aws_smithy_types::retry::ProvideErrorKind for ConverseStreamOutputError {
|
530 263 | fn code(&self) -> ::std::option::Option<&str> {
|
531 264 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
532 265 | }
|
533 266 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
534 267 | ::std::option::Option::None
|
535 268 | }
|
536 269 | }
|
537 270 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConverseStreamOutputError {
|
538 271 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
539 272 | match self {
|
540 273 | Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
541 274 | Self::ModelStreamErrorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
542 275 | Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
543 276 | Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
544 - | Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
545 277 | Self::Unhandled(_inner) => &_inner.meta,
|
546 278 | }
|
547 279 | }
|
548 280 | }
|
549 281 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ConverseStreamOutputError {
|
550 282 | fn create_unhandled_error(
|
551 283 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
552 284 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
553 285 | ) -> Self {
|
554 286 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
555 287 | source,
|
556 288 | meta: meta.unwrap_or_default(),
|
557 289 | })
|
558 290 | }
|
559 291 | }
|
560 292 | impl ::aws_types::request_id::RequestId for crate::types::error::ConverseStreamOutputError {
|
561 293 | fn request_id(&self) -> Option<&str> {
|
562 294 | self.meta().request_id()
|
563 295 | }
|
564 296 | }
|
565 297 |
|
566 - | pub use crate::types::error::_conflict_exception::ConflictException;
|
567 - |
|
568 298 | mod _access_denied_exception;
|
569 299 |
|
570 - | mod _conflict_exception;
|
571 - |
|
572 300 | mod _internal_server_exception;
|
573 301 |
|
574 302 | mod _model_error_exception;
|
575 303 |
|
576 304 | mod _model_not_ready_exception;
|
577 305 |
|
578 306 | mod _model_stream_error_exception;
|
579 307 |
|
580 308 | mod _model_timeout_exception;
|
581 309 |
|
582 310 | mod _resource_not_found_exception;
|
583 311 |
|
584 312 | mod _service_quota_exceeded_exception;
|
585 313 |
|
586 - | mod _service_unavailable_exception;
|
587 - |
|
588 314 | mod _throttling_exception;
|
589 315 |
|
590 316 | mod _validation_exception;
|
591 317 |
|
592 318 | /// Builders
|
593 319 | pub mod builders;
|