mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +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
|
import litellm
|
||||||
|
|
||||||
for var in dir(litellm):
|
for var in dir(litellm):
|
||||||
if not var.endswith("Error"):
|
if var.endswith("Error") and var not in self.exception_names:
|
||||||
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:
|
|
||||||
raise ValueError(f"{var} is in litellm but not in aider's exceptions list")
|
raise ValueError(f"{var} is in litellm but not in aider's exceptions list")
|
||||||
|
|
||||||
ex = getattr(litellm, var)
|
ex = getattr(litellm, var)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue