Skip to content
Snippets Groups Projects
Commit f8d9682a authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

DOC: Add docstring to ConsistencyError

parent f1e50bdb
Branches
Tags
No related merge requests found
...@@ -298,6 +298,7 @@ class EntityError(TransactionError): ...@@ -298,6 +298,7 @@ class EntityError(TransactionError):
server. server.
""" """
def __init__(self, error=None, entity=None): def __init__(self, error=None, entity=None):
TransactionError.__init__(self) TransactionError.__init__(self)
self.error = error self.error = error
...@@ -321,7 +322,7 @@ class EntityError(TransactionError): ...@@ -321,7 +322,7 @@ class EntityError(TransactionError):
"""Return this error message as attached by the server.""" """Return this error message as attached by the server."""
return self.error return self.error
@property @property
def description(self): def description(self):
return self.error.description if self.error is not None else None return self.error.description if self.error is not None else None
...@@ -329,8 +330,6 @@ class EntityError(TransactionError): ...@@ -329,8 +330,6 @@ class EntityError(TransactionError):
def get_code(self): def get_code(self):
return self.error.code if self.error is not None else None return self.error.code if self.error is not None else None
def _repr_head(self, indent): def _repr_head(self, indent):
if hasattr(self, 'entity') and self.entity is not None: if hasattr(self, 'entity') and self.entity is not None:
return (str(type(self.entity).__name__).upper() + " (" + return (str(type(self.entity).__name__).upper() + " (" +
...@@ -346,15 +345,19 @@ class UniqueNamesError(EntityError): ...@@ -346,15 +345,19 @@ class UniqueNamesError(EntityError):
class UnqualifiedParentsError(EntityError): class UnqualifiedParentsError(EntityError):
"""This entity has unqualified parents (call 'get_errors()' for a list of """This entity has unqualified parents (call 'get_errors()' for a list
errors of the parent entities or 'get_entities()' for a list of parent of errors of the parent entities or 'get_entities()' for a list of
entities with errors).""" parent entities with errors).
"""
class UnqualifiedPropertiesError(EntityError): class UnqualifiedPropertiesError(EntityError):
"""This entity has unqualified properties (call 'get_errors()' for a list """This entity has unqualified properties (call 'get_errors()' for a
of errors of the properties or 'get_entities()' for a list of properties list of errors of the properties or 'get_entities()' for a list of
with errors).""" properties with errors).
"""
class EntityDoesNotExistError(EntityError): class EntityDoesNotExistError(EntityError):
...@@ -366,11 +369,12 @@ class EntityHasNoDatatypeError(EntityError): ...@@ -366,11 +369,12 @@ class EntityHasNoDatatypeError(EntityError):
class ConsistencyError(EntityError): class ConsistencyError(EntityError):
pass """The transaction violates database consistecy."""
class AuthorizationException(EntityError): class AuthorizationException(EntityError):
"""You are not allowed to do what ever you tried to do. """You are not allowed to do what ever you tried to do.
Maybe you need more privileges or a user account at all. Maybe you need more privileges or a user account at all.
""" """
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment