summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/litestar/contrib/repository/exceptions.py
blob: 1e7e7389dd182cb2dec1afabea30bedb3a136ed0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from litestar.utils import warn_deprecation


def __getattr__(attr_name: str) -> object:
    from litestar.repository import exceptions

    if attr_name in exceptions.__all__:
        warn_deprecation(
            deprecated_name=f"litestar.repository.contrib.exceptions.{attr_name}",
            version="2.1",
            kind="import",
            removal_in="3.0",
            info=f"importing {attr_name} from 'litestar.contrib.repository.exceptions' is deprecated, please"
            f"import it from 'litestar.repository.exceptions.{attr_name}' instead",
        )

        value = globals()[attr_name] = getattr(exceptions, attr_name)
        return value

    raise AttributeError(f"module {__name__!r} has no attribute {attr_name!r}")