"""Frontend exceptions.""" from starlette.datastructures import URL class RedirectException(Exception): """Exception that initiates a redirect flow.""" def __init__(self, to: str | URL) -> None: # pyright: ignore[reportMissingSuperCall] """Raise exception that redirects.""" if isinstance(to, str): to = URL(to) self.to: URL = to