"""
Domain-specific exceptions for issue management.
"""


class IssueDomainError(Exception):
    """Base exception for issue domain errors."""

    def __init__(self, message: str, issue_number: int = None):
        super().__init__(message)
        self.issue_number = issue_number


class IssueValidationError(IssueDomainError):
    """Exception raised when issue validation fails."""

    def __init__(self, message: str, field: str = None, value=None):
        super().__init__(message)
        self.field = field
        self.value = value


class IssueStateError(IssueDomainError):
    """Exception raised when invalid state transitions are attempted."""

    def __init__(self, message: str, current_state: str, attempted_state: str):
        super().__init__(message)
        self.current_state = current_state
        self.attempted_state = attempted_state


class IssueNotFoundError(IssueDomainError):
    """Exception raised when an issue cannot be found."""

    def __init__(self, message: str, issue_number: int = None):
        super().__init__(message, issue_number)


class IssueLabelError(IssueDomainError):
    """Exception raised when there are label-related issues."""

    def __init__(self, message: str, label_name: str = None):
        super().__init__(message)
        self.label_name = label_name