mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 06:15:00 +00:00
feat: enable retries for OpenRouter choices errors
This commit is contained in:
parent
fd180ebff5
commit
673acf4308
2 changed files with 2 additions and 2 deletions
|
@ -85,6 +85,6 @@ class LiteLLMExceptions:
|
|||
return ExInfo("APIConnectionError", False, "You need to: pip install boto3")
|
||||
if "OpenrouterException" in str(ex) and "'choices'" in str(ex):
|
||||
return ExInfo(
|
||||
"APIConnectionError", False, "The OpenRouter API provider is down or offline"
|
||||
"APIConnectionError", True, "The OpenRouter API provider is down or offline"
|
||||
)
|
||||
return self.exceptions.get(ex.__class__, ExInfo(None, None, None))
|
||||
|
|
|
@ -78,5 +78,5 @@ def test_openrouter_error():
|
|||
)
|
||||
|
||||
ex_info = ex.get_ex_info(openrouter_error)
|
||||
assert ex_info.retry is False
|
||||
assert ex_info.retry is True
|
||||
assert "OpenRouter API provider is down" in ex_info.description
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue