class JurisError(Exception):
    """Base exception for all jurisprudencia scraping errors."""


class CaptchaError(JurisError):
    """CAPTCHA was rejected or could not be solved."""


class SessionError(JurisError):
    """Session expired or could not be established."""


class TooManyResults(JurisError):
    """Query returned more results than the site allows."""

    def __init__(self, total: int, max_allowed: int):
        self.total = total
        self.max_allowed = max_allowed
        super().__init__(f"Too many results: {total} (max: {max_allowed})")
