feat: add OpenRouter API error detection

This commit is contained in:
Paul Gauthier (aider) 2025-03-27 06:56:28 -10:00
parent 8737220fb6
commit 6e1dd4474b

View file

@ -83,4 +83,8 @@ class LiteLLMExceptions:
)
if "boto3" in str(ex):
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"
)
return self.exceptions.get(ex.__class__, ExInfo(None, None, None))