style: format exception mapping utility

This commit is contained in:
dlowzzxx 2026-09-02 13:39:10 +02:00
parent 746ca296f3
commit 44521dcfdd

View file

@ -1349,25 +1349,22 @@ def _map_vertex_exception(
),
),
)
elif (
not _structured_validation_signal(
error_str=error_str,
elif not _structured_validation_signal(
error_str=error_str,
response=getattr(original_exception, "response", None),
error_body=getattr(original_exception, "body", None),
) and (
"429 Quota exceeded" in error_str
or "Quota exceeded for" in error_str
or "Resource exhausted" in error_str
or "IndexError: list index out of range" in error_str
or "429 Unable to submit request because the service is temporarily out of capacity." in error_str
or ExceptionCheckers.is_error_str_rate_limit(
error_str,
status_code=getattr(original_exception, "status_code", None),
response=getattr(original_exception, "response", None),
error_body=getattr(original_exception, "body", None),
)
and (
"429 Quota exceeded" in error_str
or "Quota exceeded for" in error_str
or "Resource exhausted" in error_str
or "IndexError: list index out of range" in error_str
or "429 Unable to submit request because the service is temporarily out of capacity." in error_str
or ExceptionCheckers.is_error_str_rate_limit(
error_str,
status_code=getattr(original_exception, "status_code", None),
response=getattr(original_exception, "response", None),
error_body=getattr(original_exception, "body", None),
)
)
):
raise RateLimitError(
message=f"litellm.RateLimitError: {custom_llm_provider}Exception - {error_str}",