fix: add a special error type for configuration errors (#2198)

This commit is contained in:
Charles Packer
2024-12-08 17:04:04 -08:00
committed by GitHub
parent 3fd61ea7f0
commit 85d3e649ee
4 changed files with 67 additions and 9 deletions

View File

@@ -22,6 +22,30 @@ class LettaToolCreateError(LettaError):
super().__init__(self.message)
class LettaConfigurationError(LettaError):
"""Error raised when there are configuration-related issues."""
def __init__(self, message: str, missing_fields: Optional[List[str]] = None):
self.missing_fields = missing_fields or []
super().__init__(message)
class LettaAgentNotFoundError(LettaError):
"""Error raised when an agent is not found."""
def __init__(self, message: str):
self.message = message
super().__init__(self.message)
class LettaUserNotFoundError(LettaError):
"""Error raised when a user is not found."""
def __init__(self, message: str):
self.message = message
super().__init__(self.message)
class LLMError(LettaError):
pass