diff --git a/litellm/tests/test_amazing_vertex_completion.py b/litellm/tests/test_amazing_vertex_completion.py index 5d1198d538..05eece8344 100644 --- a/litellm/tests/test_amazing_vertex_completion.py +++ b/litellm/tests/test_amazing_vertex_completion.py @@ -394,6 +394,8 @@ async def test_async_vertexai_response(): pass except litellm.Timeout as e: pass + except litellm.APIError as e: + pass except Exception as e: pytest.fail(f"An exception occurred: {e}") diff --git a/litellm/utils.py b/litellm/utils.py index e5f7f9d11a..5c5324be13 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -8130,7 +8130,10 @@ def exception_type( llm_provider="vertex_ai", 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 raise APIError( message=f"VertexAIException - {error_str}",