diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-11 08:46:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-11 08:46:20 +0000 |
commit | 60b8ecaf2afb874b733c1c61be26da68df51d989 (patch) | |
tree | 8888727f276e44d23fc64b6b285dc00150a7a466 /treelib/exceptions.py | |
parent | Initial commit. (diff) | |
download | treelib-60b8ecaf2afb874b733c1c61be26da68df51d989.tar.xz treelib-60b8ecaf2afb874b733c1c61be26da68df51d989.zip |
Adding upstream version 1.6.4.upstream/1.6.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'treelib/exceptions.py')
-rw-r--r-- | treelib/exceptions.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/treelib/exceptions.py b/treelib/exceptions.py new file mode 100644 index 0000000..fc955c5 --- /dev/null +++ b/treelib/exceptions.py @@ -0,0 +1,50 @@ +class NodePropertyError(Exception): + """Basic Node attribute error""" + + pass + + +class NodeIDAbsentError(NodePropertyError): + """Exception throwed if a node's identifier is unknown""" + + pass + + +class NodePropertyAbsentError(NodePropertyError): + """Exception throwed if a node's data property is not specified""" + + pass + + +class MultipleRootError(Exception): + """Exception throwed if more than one root exists in a tree.""" + + pass + + +class DuplicatedNodeIdError(Exception): + """Exception throwed if an identifier already exists in a tree.""" + + pass + + +class LinkPastRootNodeError(Exception): + """ + Exception throwed in Tree.link_past_node() if one attempts + to "link past" the root node of a tree. + """ + + pass + + +class InvalidLevelNumber(Exception): + pass + + +class LoopError(Exception): + """ + Exception thrown if trying to move node B to node A's position + while A is B's ancestor. + """ + + pass |