From 7201abc56539ae8ee2bf4ea0926f584c9ec5558c Mon Sep 17 00:00:00 2001 From: dotlambda Date: Wed, 26 Nov 2025 23:55:14 -0800 Subject: [PATCH] fix: add new exceptions to LiteLLMExceptions --- aider/exceptions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/exceptions.py b/aider/exceptions.py index a81a058e038..4550d1ebf24 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -20,6 +20,7 @@ class ExInfo: "The API provider is not able to authenticate you. Check your API key.", ), ExInfo("AzureOpenAIError", True, None), + ExInfo("BadGatewayError", True, None), ExInfo("BadRequestError", False, None), ExInfo("BudgetExceededError", True, None), ExInfo( @@ -28,6 +29,7 @@ class ExInfo: "The API provider has refused the request due to a safety policy about the content.", ), ExInfo("ContextWindowExceededError", False, None), # special case handled in base_coder + ExInfo("ImageFetchError", False, None), ExInfo("InternalServerError", True, "The API provider's servers are down or overloaded."), ExInfo("InvalidRequestError", True, None), ExInfo("JSONSchemaValidationError", True, None), @@ -62,7 +64,7 @@ def _load(self, strict=False): for var in dir(litellm): if var.endswith("Error"): - if var not in self.exception_info: + if var not in self.exception_info and var not in [ "ErrorEventError" ]: raise ValueError(f"{var} is in litellm but not in aider's exceptions list") for var in self.exception_info: