Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
f8d9682a
Commit
f8d9682a
authored
4 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Add docstring to ConsistencyError
parent
f1e50bdb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosdb/exceptions.py
+14
-10
14 additions, 10 deletions
src/caosdb/exceptions.py
with
14 additions
and
10 deletions
src/caosdb/exceptions.py
+
14
−
10
View file @
f8d9682a
...
@@ -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.
"""
"""
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment