# app/modules/monitoring/exceptions.py """ Monitoring module exceptions. Module-specific exceptions for monitoring functionality. """ from app.exceptions.base import ( BusinessLogicException, ResourceNotFoundException, ) class TaskNotFoundException(ResourceNotFoundException): """Raised when a background task is not found.""" def __init__(self, task_id: str): super().__init__( resource_type="BackgroundTask", identifier=task_id, error_code="TASK_NOT_FOUND", ) class CapacitySnapshotNotFoundException(ResourceNotFoundException): """Raised when a capacity snapshot is not found.""" def __init__(self, snapshot_id: int): super().__init__( resource_type="CapacitySnapshot", identifier=str(snapshot_id), error_code="CAPACITY_SNAPSHOT_NOT_FOUND", ) class MonitoringServiceException(BusinessLogicException): """Raised when a monitoring operation fails.""" def __init__(self, operation: str, reason: str): super().__init__( message=f"Monitoring operation '{operation}' failed: {reason}", error_code="MONITORING_OPERATION_FAILED", ) __all__ = [ "TaskNotFoundException", "CapacitySnapshotNotFoundException", "MonitoringServiceException", ]