diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py index bb775fcbf..ca889c7cb 100644 --- a/fastapi/exceptions.py +++ b/fastapi/exceptions.py @@ -147,6 +147,12 @@ class FastAPIError(RuntimeError): """ +class DependencyScopeError(FastAPIError): + """ + A dependency declared that it depends on another dependency with an invalid + (narrower) scope. + """ + class ValidationException(Exception): def __init__(self, errors: Sequence[Any]) -> None: self._errors = errors