From f8d9682a1af851ae7d217f21d01eabfc805a64be Mon Sep 17 00:00:00 2001 From: fspreck <f.spreckelsen@indiscale.com> Date: Fri, 3 Jul 2020 14:20:40 +0200 Subject: [PATCH] DOC: Add docstring to ConsistencyError --- src/caosdb/exceptions.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/caosdb/exceptions.py b/src/caosdb/exceptions.py index a28a2394..f86be16c 100644 --- a/src/caosdb/exceptions.py +++ b/src/caosdb/exceptions.py @@ -298,6 +298,7 @@ class EntityError(TransactionError): server. """ + def __init__(self, error=None, entity=None): TransactionError.__init__(self) self.error = error @@ -321,7 +322,7 @@ class EntityError(TransactionError): """Return this error message as attached by the server.""" return self.error - + @property def description(self): return self.error.description if self.error is not None else None @@ -329,8 +330,6 @@ class EntityError(TransactionError): def get_code(self): return self.error.code if self.error is not None else None - - def _repr_head(self, indent): if hasattr(self, 'entity') and self.entity is not None: return (str(type(self.entity).__name__).upper() + " (" + @@ -346,15 +345,19 @@ class UniqueNamesError(EntityError): class UnqualifiedParentsError(EntityError): - """This entity has unqualified parents (call 'get_errors()' for a list of - errors of the parent entities or 'get_entities()' for a list of parent - entities with errors).""" + """This entity has unqualified parents (call 'get_errors()' for a list + of errors of the parent entities or 'get_entities()' for a list of + parent entities with errors). + + """ class UnqualifiedPropertiesError(EntityError): - """This entity has unqualified properties (call 'get_errors()' for a list - of errors of the properties or 'get_entities()' for a list of properties - with errors).""" + """This entity has unqualified properties (call 'get_errors()' for a + list of errors of the properties or 'get_entities()' for a list of + properties with errors). + + """ class EntityDoesNotExistError(EntityError): @@ -366,11 +369,12 @@ class EntityHasNoDatatypeError(EntityError): class ConsistencyError(EntityError): - pass + """The transaction violates database consistecy.""" class AuthorizationException(EntityError): """You are not allowed to do what ever you tried to do. Maybe you need more privileges or a user account at all. + """ -- GitLab