mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-21 12:55:00 +00:00
test: add coverage for OpenRouter API error detection
This commit is contained in:
parent
6e1dd4474b
commit
61705ce7fc
1 changed files with 17 additions and 0 deletions
|
@ -63,3 +63,20 @@ def test_context_window_error():
|
|||
)
|
||||
ex_info = ex.get_ex_info(ctx_error)
|
||||
assert ex_info.retry is False
|
||||
|
||||
|
||||
def test_openrouter_error():
|
||||
"""Test specific handling of OpenRouter API errors"""
|
||||
ex = LiteLLMExceptions()
|
||||
from litellm import APIConnectionError
|
||||
|
||||
# Create an APIConnectionError with OpenrouterException message
|
||||
openrouter_error = APIConnectionError(
|
||||
message="APIConnectionError: OpenrouterException - 'choices'",
|
||||
model="openrouter/model",
|
||||
llm_provider="openrouter"
|
||||
)
|
||||
|
||||
ex_info = ex.get_ex_info(openrouter_error)
|
||||
assert ex_info.retry is False
|
||||
assert "OpenRouter API provider is down" in ex_info.description
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue