"""Exception classes for the Sirius Prediction Market API client."""


class SiriusAPIError(Exception):
    """Base exception for all Sirius API errors.

    Attributes:
        status_code: HTTP status code returned by the API.
        message: Human-readable error message.
        response_body: Raw response body, if available.
    """

    def __init__(
        self,
        message: str,
        status_code: int = 0,
        response_body: str = "",
    ) -> None:
        self.status_code = status_code
        self.message = message
        self.response_body = response_body
        super().__init__(self.message)

    def __str__(self) -> str:
        if self.status_code:
            return "[HTTP {}] {}".format(self.status_code, self.message)
        return self.message


class SiriusAuthError(SiriusAPIError):
    """Raised when authentication fails (HTTP 401).

    Typically means the RapidAPI key is missing or invalid.
    """


class SiriusForbiddenError(SiriusAPIError):
    """Raised when access is denied (HTTP 403).

    Typically means the current subscription tier does not
    include the requested endpoint.
    """


class SiriusRateLimitError(SiriusAPIError):
    """Raised when the rate limit is exceeded (HTTP 429).

    Wait and retry, or upgrade your RapidAPI subscription.
    """


class SiriusNotFoundError(SiriusAPIError):
    """Raised when the requested resource is not found (HTTP 404)."""


class SiriusServerError(SiriusAPIError):
    """Raised on server-side errors (HTTP 5xx)."""
