aaa / app /core /exceptions.py
work-sejal
Deploy AI service with FastAPI
70ea7be
Raw
History Blame Contribute Delete
789 Bytes
"""Custom exception classes for the AI Services V2 layer."""
class DatasetError(Exception):
"""Raised when dataset operations fail (missing file, schema mismatch)."""
class TrainingError(Exception):
"""Raised when a model training pipeline fails.
Attributes:
model_name: The name of the model whose training failed.
message: Human-readable description of the failure.
"""
def __init__(self, message: str, model_name: str) -> None:
self.model_name = model_name
super().__init__(f"[{model_name}] {message}")
class ModelNotLoadedError(Exception):
"""Raised when inference is attempted on an unloaded model."""
class EntityNotFoundError(Exception):
"""Raised when a referenced entity (student, LO, class) doesn't exist."""