14 lines
379 B
Python
14 lines
379 B
Python
"""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
|