class BaseCRException(Exception):
    """Base class for all exceptions raised by the ChattedRooms SDK."""

    def __init__(self, message: str) -> None:
        super().__init__(message)


class AuthorizationFailed(BaseCRException):
    """Exception raised when the user's authorization failed."""
    def __init__(self, message: str) -> None:
        super().__init__(message)

class ServerSideAuthError(AuthorizationFailed):
    """Exception raised when the server does an oopsie while authenticating the user."""
    def __init__(self, message: str) -> None:
        super().__init__(message)


class Unauthorized(BaseCRException):
    """Exception raised when the user is not authorized to access a resource."""

    def __init__(self, message: str) -> None:
        super().__init__(message)

class MessageSentError(BaseCRException):
    """Exception raised when a message fails to send.
    This could be from either a network issue or a server-side issue."""

    def __init__(self, message: str) -> None:
        super().__init__(message)

class ChatError(BaseCRException):
    """Exception raised when there is an error with a chat operation."""

    def __init__(self, message: str) -> None:
        super().__init__(message)

class ChatDeletionError(ChatError):
    """Exception raised when a chat fails to delete."""

    def __init__(self, message: str) -> None:
        super().__init__(message)