forked from phoenix/litellm-mirror
fix exception mapping for vertex ai
This commit is contained in:
parent
fdb9b24b9f
commit
8f3bd0780b
1 changed files with 17 additions and 0 deletions
|
@ -6297,6 +6297,7 @@ def exception_type(
|
||||||
)
|
)
|
||||||
elif (
|
elif (
|
||||||
"429 Quota exceeded" in error_str
|
"429 Quota exceeded" in error_str
|
||||||
|
or "Quota exceeded for" in error_str
|
||||||
or "IndexError: list index out of range" 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."
|
or "429 Unable to submit request because the service is temporarily out of capacity."
|
||||||
in error_str
|
in error_str
|
||||||
|
@ -6339,6 +6340,22 @@ def exception_type(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if original_exception.status_code == 429:
|
||||||
|
exception_mapping_worked = True
|
||||||
|
raise RateLimitError(
|
||||||
|
message=f"litellm.RateLimitError: VertexAIException - {error_str}",
|
||||||
|
model=model,
|
||||||
|
llm_provider="vertex_ai",
|
||||||
|
litellm_debug_info=extra_information,
|
||||||
|
response=httpx.Response(
|
||||||
|
status_code=429,
|
||||||
|
request=httpx.Request(
|
||||||
|
method="POST",
|
||||||
|
url=" https://cloud.google.com/vertex-ai/",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
if original_exception.status_code == 500:
|
if original_exception.status_code == 500:
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise litellm.InternalServerError(
|
raise litellm.InternalServerError(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue