Source code for decision_graph.decision_tree.exc

__all__ = [
    'NO_DEFAULT',
    'EmptyBlock', 'BreakBlock',
    'NodeError', 'TooManyChildren', 'TooFewChildren', 'NodeNotFountError', 'NodeValueError', 'NodeTypeError', 'NodeContextError',
    'EdgeValueError',
    'ResolutionError', 'ExpressFalse', 'ContextsNotFound'
]

NO_DEFAULT = object()


[docs] class EmptyBlock(Exception): """Raised when a SkippableContextBlock is empty.""" pass
[docs] class BreakBlock(Exception): """Base exception for skipping a SkippableContextBlock. Internal use only.""" pass
[docs] class NodeError(Exception): """Base exception for node-related errors.""" pass
[docs] class TooManyChildren(NodeError): """Raised when a node has too many children or when trying to add a child node exceeding its limits, and other exception situations related to or caused by too many child nodes.""" pass
[docs] class TooFewChildren(NodeError): """Raised when a node has too few children.""" pass
[docs] class NodeNotFountError(NodeError): """Raised when a specified node cannot be found.""" pass
[docs] class NodeValueError(NodeError): """Raised when a node has an invalid value.""" pass
[docs] class NodeTypeError(NodeError): """Raised when a node has an invalid type.""" pass
[docs] class NodeContextError(NodeError): """Raised when errors occur in the LogicNode context manager protocol.""" pass
[docs] class EdgeValueError(NodeError): """Raised when a NodeEdgeCondition has an invalid value.""" pass
[docs] class ResolutionError(NodeError): """Raised when an error occurs during resolution.""" pass
[docs] class ExpressFalse(Exception): """Custom exception raised when a LogicExpression evaluates to False.""" pass
[docs] class ContextsNotFound(Exception): """Raised when required contexts of ``LogicGroup`` are not found.""" pass