From 6e1dd4474be0751930f0ebda62def1eda83df165 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 27 Mar 2025 06:56:28 -1000 Subject: [PATCH] feat: add OpenRouter API error detection --- aider/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aider/exceptions.py b/aider/exceptions.py index 2fc810430..9df758026 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -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))