forked from phoenix/litellm-mirror
fix(utils.py): add exception mapping for gemini error
This commit is contained in:
parent
638477a023
commit
3cc82f558e
2 changed files with 6 additions and 1 deletions
|
@ -394,6 +394,8 @@ async def test_async_vertexai_response():
|
||||||
pass
|
pass
|
||||||
except litellm.Timeout as e:
|
except litellm.Timeout as e:
|
||||||
pass
|
pass
|
||||||
|
except litellm.APIError as e:
|
||||||
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"An exception occurred: {e}")
|
pytest.fail(f"An exception occurred: {e}")
|
||||||
|
|
||||||
|
|
|
@ -8130,7 +8130,10 @@ def exception_type(
|
||||||
llm_provider="vertex_ai",
|
llm_provider="vertex_ai",
|
||||||
response=original_exception.response,
|
response=original_exception.response,
|
||||||
)
|
)
|
||||||
elif "None Unknown Error." in error_str:
|
elif (
|
||||||
|
"None Unknown Error." in error_str
|
||||||
|
or "Content has no parts." in error_str
|
||||||
|
):
|
||||||
exception_mapping_worked = True
|
exception_mapping_worked = True
|
||||||
raise APIError(
|
raise APIError(
|
||||||
message=f"VertexAIException - {error_str}",
|
message=f"VertexAIException - {error_str}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue