mbdlyb.exceptions ================= .. py:module:: mbdlyb.exceptions .. autoapi-nested-parse:: Custom exception classes for the MBDlyb library. Provides specialized exception types for various error conditions that can occur during MBD model creation, manipulation, and reasoning. Exceptions ---------- .. autoapisummary:: mbdlyb.exceptions.ElementExistsError mbdlyb.exceptions.ElementNotFoundError mbdlyb.exceptions.InvalidReasonerError mbdlyb.exceptions.InvalidRelationError mbdlyb.exceptions.InvalidValueError Module Contents --------------- .. py:exception:: ElementExistsError(fqn: mbdlyb.fqn.FQN, containing_element: mbdlyb.fqn.FQN) Bases: :py:obj:`Exception` Exception raised when attempting to add a duplicate element to a network. Raised when an attempt is made to create an element with a name that already exists in the same parent network. .. py:exception:: ElementNotFoundError(fqn: mbdlyb.fqn.FQN, containing_element: mbdlyb.fqn.FQN) Bases: :py:obj:`Exception` Exception raised when attempting to access a non-existent element. Raised when an attempt is made to retrieve an element that does not exist in the specified network. .. py:exception:: InvalidReasonerError(message: str) Bases: :py:obj:`RuntimeError` Exception raised when a reasoner operation cannot be completed. Raised when attempting to use a reasoner in an invalid state, with incompatible settings, or when reasoning fails due to model constraints. .. py:exception:: InvalidRelationError(msg: str) Bases: :py:obj:`RuntimeError` Exception raised when a relation cannot be created or modified as specified. Raised when attempting to create a relation that violates constraints, such as insufficient nodes, invalid node types, or rejection by node validation methods. .. py:exception:: InvalidValueError(message: str, closest_idx: Optional[int] = None) Bases: :py:obj:`ValueError` Exception raised when a value is not valid for a given variable or property. Raised when attempting to set or use a value that is not in the valid set of states or values for a variable. Optionally stores the index of the closest valid value for error recovery purposes. .. py:attribute:: closest_idx :value: None