diff --git a/dependency_injector/errors.py b/dependency_injector/errors.py index 37be4f82..b5f9fc04 100644 --- a/dependency_injector/errors.py +++ b/dependency_injector/errors.py @@ -2,8 +2,21 @@ class Error(Exception): - """Base error.""" + """Base error. + + All dependency injector errors extend this error class. + """ class UndefinedProviderError(Error, AttributeError): - """Undefined provider error.""" + """Undefined provider error. + + This error is used when provider could not be defined, for example: + + - provider with certain name could not be defined + - catalog's name of the certain provider could not be defined + - etc... + + Also this error extends standard :py:class:`AttributeError`. This gives + possibility to use it correctly with ``__getattr__()``. + """ diff --git a/docs/api/errors.rst b/docs/api/errors.rst index c37ad8f7..2018c7c5 100644 --- a/docs/api/errors.rst +++ b/docs/api/errors.rst @@ -2,4 +2,5 @@ ------------------------------ .. automodule:: dependency_injector.errors - :members: + :members: + :member-order: bysource