Add exception docs to developer docs

Change-Id: Ie58db0660f5dad1b5bf14edf4512226648829980
This commit is contained in:
Joshua Harlow 2015-04-15 08:56:31 -07:00
parent edd499fdc5
commit a890d34265
2 changed files with 18 additions and 0 deletions

View File

@ -55,3 +55,16 @@ Zookeeper
.. autoclass:: tooz.drivers.zookeeper.KazooDriver
:members:
Exceptions
----------
.. autoclass:: tooz.coordination.ToozError
.. autoclass:: tooz.coordination.ToozConnectionError
.. autoclass:: tooz.coordination.OperationTimedOut
.. autoclass:: tooz.coordination.GroupNotCreated
.. autoclass:: tooz.coordination.GroupAlreadyExist
.. autoclass:: tooz.coordination.MemberAlreadyExist
.. autoclass:: tooz.coordination.MemberNotJoined
.. autoclass:: tooz.coordination.GroupNotEmpty
.. autofunction:: tooz.coordination.raise_with_cause

View File

@ -376,6 +376,11 @@ def get_coordinator(backend_url, member_id, **kwargs):
class ToozError(Exception):
"""Exception raised when an internal error occurs, for instance in
case of server internal error.
:ivar cause: the cause of the exception being raised, when provided this
should itself be an exception instance, this is useful for
creating a chain of exceptions for versions of python where
this is not yet implemented/supported natively
"""
def __init__(self, message, cause=None):