From a890d34265a4b64b6075abbc9c16e28f100853e4 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 15 Apr 2015 08:56:31 -0700 Subject: [PATCH] Add exception docs to developer docs Change-Id: Ie58db0660f5dad1b5bf14edf4512226648829980 --- doc/source/developers.rst | 13 +++++++++++++ tooz/coordination.py | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/doc/source/developers.rst b/doc/source/developers.rst index b24cf9d..e592f0a 100644 --- a/doc/source/developers.rst +++ b/doc/source/developers.rst @@ -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 diff --git a/tooz/coordination.py b/tooz/coordination.py index dc4e869..32641ba 100644 --- a/tooz/coordination.py +++ b/tooz/coordination.py @@ -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):