diff --git a/litellm/tests/test_batch_completions.py b/litellm/tests/test_batch_completions.py index 485f51757..cd5eb251e 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 74005a3c5..00d627c6b 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,