[docs]class BinaryTreeError(Exception):
"""Base (catch-all) binarytree exception."""
[docs]class NodeIndexError(BinaryTreeError):
"""Node index was invalid."""
[docs]class NodeModifyError(BinaryTreeError):
"""User tried to overwrite or delete the root node."""
[docs]class NodeNotFoundError(BinaryTreeError):
"""Node was missing from the binary tree."""
[docs]class NodeReferenceError(BinaryTreeError):
"""Node reference was invalid (e.g. cyclic reference)."""
[docs]class NodeTypeError(BinaryTreeError):
"""Node was not an instance of :class:`binarytree.Node`."""
[docs]class NodeValueError(BinaryTreeError):
"""Node value was not a number (e.g. float, int, str)."""
[docs]class TreeHeightError(BinaryTreeError):
"""Tree height was invalid."""