From c21e954c6f5153931d05e355966ed255f6ac0d0a Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 26 Mar 2024 13:55:03 -0700 Subject: [PATCH] test(test_batch_completions.py): handle anthropic overloaded error --- litellm/tests/test_batch_completions.py | 2 ++ litellm/utils.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/tests/test_batch_completions.py b/litellm/tests/test_batch_completions.py index 485f51757b..cd5eb251e8 100644 --- a/litellm/tests/test_batch_completions.py +++ b/litellm/tests/test_batch_completions.py @@ -74,6 +74,8 @@ def test_batch_completion_models_all_responses(): assert len(responses) == 2 except Timeout as e: pass + except litellm.APIError as e: + pass except Exception as e: pytest.fail(f"An error occurred: {e}") diff --git a/litellm/utils.py b/litellm/utils.py index 74005a3c5f..00d627c6b6 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -7231,7 +7231,7 @@ def exception_type( exception_mapping_worked = True raise APIError( status_code=original_exception.status_code, - message=f"AnthropicException - {original_exception.message}", + message=f"AnthropicException - {original_exception.message}. Handle with `litellm.APIError`.", llm_provider="anthropic", model=model, request=original_exception.request,