You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use amzn_codewhisperer_streaming_client::operation::generate_assistant_response::GenerateAssistantResponseError::ThrottlingErrorasOperationThrottlingError;
289
+
use amzn_codewhisperer_streaming_client::types::ThrottlingExceptionReason;
290
+
use amzn_codewhisperer_streaming_client::types::error::ThrottlingError;
291
+
288
292
let status_code = err.raw_response().map(|res| res.status().as_u16());
289
293
let is_quota_breach = status_code.is_some_and(|status| status == 429);
290
294
let is_context_window_overflow = err.as_service_error().is_some_and(|err| {
291
295
matches!(err, err if err.meta().code() == Some("ValidationException") && err.meta().message() == Some("Input is too long."))
292
296
});
293
297
294
-
let is_model_unavailable = model_id_opt.is_some()
295
-
&& status_code.is_some_and(|status| status == 500)
296
-
&& err.as_service_error().is_some_and(|err| {
297
-
err.meta().message()
298
-
== Some(
299
-
"Encountered unexpectedly high load when processing the request, please try again.",
0 commit comments