mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
refactor: Simplify exception validation logic in LiteLLMExceptions
This commit is contained in:
parent
54122af9d7
commit
af8bdcd9e0
1 changed files with 1 additions and 11 deletions
|
@ -61,17 +61,7 @@ class LiteLLMExceptions:
|
|||
import litellm
|
||||
|
||||
for var in dir(litellm):
|
||||
if not var.endswith("Error"):
|
||||
continue
|
||||
|
||||
ex_info = None
|
||||
if var in self.exception_names:
|
||||
for exi in EXCEPTIONS:
|
||||
if var == exi.name:
|
||||
ex_info = exi
|
||||
break
|
||||
|
||||
if strict and not ex_info:
|
||||
if var.endswith("Error") and var not in self.exception_names:
|
||||
raise ValueError(f"{var} is in litellm but not in aider's exceptions list")
|
||||
|
||||
ex = getattr(litellm, var)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue