"""Domain exceptions.""" class DomainException(Exception): """Base exception for domain layer.""" def __init__(self, message: str) -> None: self.message = message super().__init__(self.message) class ValidationException(DomainException): """Raised when validation fails.""" pass class NotFoundException(DomainException): """Raised when an entity is not found.""" pass class AlreadyExistsException(DomainException): """Raised when trying to create an entity that already exists.""" pass class UnauthorizedException(DomainException): """Raised when user is not authorized.""" pass class ForbiddenException(DomainException): """Raised when access is forbidden.""" pass