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