mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(vertex_ai.py): fix exception mapping for vertex ai
This commit is contained in:
parent
704af2ca34
commit
f24786095a
4 changed files with 107 additions and 87 deletions
|
@ -3816,6 +3816,23 @@ def exception_type(
|
|||
llm_provider="vertex_ai",
|
||||
response=original_exception.response
|
||||
)
|
||||
if hasattr(original_exception, "status_code"):
|
||||
if original_exception.status_code == 400:
|
||||
exception_mapping_worked = True
|
||||
raise BadRequestError(
|
||||
message=f"VertexAIException - {error_str}",
|
||||
model=model,
|
||||
llm_provider="vertex_ai",
|
||||
response=original_exception.response
|
||||
)
|
||||
if original_exception.status_code == 500:
|
||||
exception_mapping_worked = True
|
||||
raise APIError(
|
||||
message=f"VertexAIException - {error_str}",
|
||||
model=model,
|
||||
llm_provider="vertex_ai",
|
||||
request=original_exception.request
|
||||
)
|
||||
elif custom_llm_provider == "palm":
|
||||
if "503 Getting metadata" in error_str:
|
||||
# auth errors look like this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue