class VeriCorpError(Exception):
    """Base error for VeriCorp API."""

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


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

    def __init__(self, retry_after: int | None = None):
        super().__init__("Rate limit exceeded", 429)
        self.retry_after = retry_after


class InvalidTaxIdError(VeriCorpError):
    """Raised when the tax ID format is invalid (400)."""

    def __init__(self, tax_id: str):
        super().__init__(f"Invalid tax ID: {tax_id}", 400)
        self.tax_id = tax_id


class NotFoundError(VeriCorpError):
    """Raised when a company is not found (404)."""

    def __init__(self, tax_id: str):
        super().__init__(f"Company not found: {tax_id}", 404)
        self.tax_id = tax_id


class TimeoutError(VeriCorpError):
    """Raised when a request times out."""

    def __init__(self):
        super().__init__("Request timed out")
