diff --git a/src/caosdb/exceptions.py b/src/caosdb/exceptions.py index a28a239416d74d51d107a5b75c52c9ab8d3699e2..f86be16c61f2fa23ca373e0061ec5a480a1f8c19 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. + """