diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index f5e145769b..8e695f3f71 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -2139,6 +2139,8 @@ async def test_acompletion_gemini(): response = await litellm.acompletion(model=model_name, messages=messages) # Add any assertions here to check the response print(f"response: {response}") + except litellm.Timeout as e: + pass except litellm.APIError as e: pass except Exception as e: diff --git a/litellm/utils.py b/litellm/utils.py index c2b1a730f1..d09f330a1d 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -7105,7 +7105,10 @@ def exception_type( llm_provider="palm", response=original_exception.response, ) - if "504 Deadline expired before operation could complete." in error_str: + if ( + "504 Deadline expired before operation could complete." in error_str + or "504 Deadline Exceeded" in error_str + ): exception_mapping_worked = True raise Timeout( message=f"PalmException - {original_exception.message}",