mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
style: format exception mapping utility
This commit is contained in:
parent
746ca296f3
commit
44521dcfdd
1 changed files with 13 additions and 16 deletions
|
|
@ -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}",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue