"""AAL SDK error types."""

from __future__ import annotations


class AALError(Exception):
    """Error returned by the AAL API."""

    def __init__(
        self,
        message: str,
        status: int,
        code: str,
        request_id: str | None = None,
    ) -> None:
        super().__init__(message)
        self.status = status
        self.code = code
        self.request_id = request_id

    def __repr__(self) -> str:
        return f"AALError(status={self.status}, code={self.code!r}, message={str(self)!r})"
