This commit is contained in:
Nathan Weinberg 2025-09-19 09:44:11 +02:00 committed by GitHub
commit 7fe8fd4285
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 11 deletions

View file

@ -9,6 +9,8 @@
# 2. All classes should have a custom error message with the goal of informing the Llama Stack user specifically
# 3. All classes should propogate the inherited __init__ function otherwise via 'super().__init__(message)'
from llama_stack.providers.utils.sqlstore.sqlstore import SqlStoreType
class ResourceNotFoundError(ValueError):
"""generic exception for a missing Llama Stack resource"""
@ -28,6 +30,16 @@ class UnsupportedModelError(ValueError):
super().__init__(message)
class UnsupportedSqlStoreError(ValueError):
"""raised when SQL store is not present in the list of supported SQL stores"""
def __init__(self, sqlstore_type: str):
message = (
f"'{sqlstore_type}' SQL store is not supported. Supported SQL stores are: {', '.join(list(SqlStoreType))}"
)
super().__init__(message)
class ModelNotFoundError(ResourceNotFoundError):
"""raised when Llama Stack cannot find a referenced model"""