refactor: Simplify exception handling and remove redundant validation in LiteLLMExceptions

This commit is contained in:
Paul Gauthier 2025-02-06 09:53:42 -08:00 committed by Paul Gauthier (aider)
parent b9e15a1340
commit 46058c275c
2 changed files with 6 additions and 3 deletions

View file

@ -65,9 +65,10 @@ class LiteLLMExceptions:
if var not in self.exception_info:
raise ValueError(f"{var} is in litellm but not in aider's exceptions list")
ex = getattr(litellm, var)
dump(var, ex)
self.exceptions[ex] = self.exception_info[var]
for var in self.exception_info:
ex = getattr(litellm, var)
dump(var, ex)
self.exceptions[ex] = self.exception_info[var]
def exceptions_tuple(self):
return tuple(self.exceptions)