From 2b77c1c2e9f4867ac5d6c1a52802b898d5948ff1 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 20 Sep 2026 01:28:18 +0000 Subject: [PATCH] test(errors): exercise unmapped branch without changing openai mapping Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../litellm_core_utils/exception_mapping_utils.py | 2 +- .../test_exception_mapping_utils.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.py index 8a28106810f..022873214a8 100644 --- a/litellm/litellm_core_utils/exception_mapping_utils.py +++ b/litellm/litellm_core_utils/exception_mapping_utils.py @@ -2462,7 +2462,7 @@ def exception_type( or custom_llm_provider in litellm.openai_compatible_providers or custom_llm_provider == "mistral" or custom_llm_provider == "runwayml" - ) and (hasattr(original_exception, "request") or hasattr(original_exception, "status_code")): + ): _map_openai_exception( model=model, original_exception=mappable_exception, diff --git a/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py b/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py index 491b76bef3e..5c5c2c9536b 100644 --- a/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py +++ b/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py @@ -975,11 +975,9 @@ def test_an_unmapped_exception_with_no_model_or_provider_is_a_connection_error(q def test_unmapped_sdk_exception_includes_bug_report_link(quiet_exception_mapping): with pytest.raises(litellm.APIConnectionError) as raised: exception_type( - model="gpt-4o", - custom_llm_provider="openai", + model="my-model", + custom_llm_provider="minimax", original_exception=ValueError("boom"), - completion_kwargs={}, - extra_kwargs={}, ) assert "https://github.com/BerriAI/litellm/issues/new?" in str(raised.value) @@ -991,11 +989,9 @@ def test_unmapped_sdk_exception_bug_report_link_can_be_disabled(quiet_exception_ with pytest.raises(litellm.APIConnectionError) as raised: exception_type( - model="gpt-4o", - custom_llm_provider="openai", + model="my-model", + custom_llm_provider="minimax", original_exception=ValueError("boom"), - completion_kwargs={}, - extra_kwargs={}, ) assert "https://github.com/BerriAI/litellm/issues/new?" not in str(raised.value)