test(errors): exercise unmapped branch without changing openai mapping

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
ryan 2026-09-20 01:28:18 +00:00
parent 6f5286b48e
commit 2b77c1c2e9
2 changed files with 5 additions and 9 deletions

View file

@ -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,

View file

@ -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)