# app/exceptions/platform.py """ Platform-related exceptions. Custom exceptions for platform management operations. """ from app.exceptions.base import WizamartException class PlatformNotFoundException(WizamartException): """Raised when a platform is not found.""" def __init__(self, code: str): super().__init__( message=f"Platform not found: {code}", error_code="PLATFORM_NOT_FOUND", status_code=404, details={"platform_code": code}, ) class PlatformInactiveException(WizamartException): """Raised when trying to access an inactive platform.""" def __init__(self, code: str): super().__init__( message=f"Platform is inactive: {code}", error_code="PLATFORM_INACTIVE", status_code=403, details={"platform_code": code}, ) class PlatformUpdateException(WizamartException): """Raised when platform update fails.""" def __init__(self, code: str, reason: str): super().__init__( message=f"Failed to update platform {code}: {reason}", error_code="PLATFORM_UPDATE_FAILED", status_code=400, details={"platform_code": code, "reason": reason}, )