"""
Custom exceptions for getbiji_box package.

All exceptions inherit from GetBijiError for easy catching.
"""


class GetBijiError(Exception):
    """Base exception for all GetBiji errors."""

    pass


class AuthenticationError(GetBijiError):
    """Raised when authentication fails."""

    pass


class TokenExpiredError(AuthenticationError):
    """Raised when the access token has expired."""

    pass


class APIError(GetBijiError):
    """
    Raised when the API returns an error response.

    Attributes:
        code: The error code from the API response
        message: The error message from the API response
    """

    def __init__(self, code: int, message: str):
        self.code = code
        self.message = message
        super().__init__(f"API Error {code}: {message}")


class UploadError(GetBijiError):
    """Raised when file upload fails."""

    pass


class ValidationError(GetBijiError):
    """Raised when input validation fails."""

    pass


class RateLimitError(GetBijiError):
    """Raised when API rate limit is exceeded."""

    pass


class NetworkError(GetBijiError):
    """Raised when network communication fails."""

    pass
