From dc79339caecf8997ce533899bee47eb2b3c21c12 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Sat, 14 Nov 2015 23:43:42 +0200 Subject: [PATCH] Add errors module API docs --- dependency_injector/errors.py | 17 +++++++++++++++-- docs/api/errors.rst | 3 ++- 2 files changed, 17 insertions(+), 3 deletions(-) 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