Exceptionsο
Core exceptions for the LinkForge library.
Custom exceptions for the LinkForge ecosystem.
Defines the exception hierarchy used across models, parsers, and generators to provide granular error handling and categorized validation failures.
- Core Components:
ValidationErrorCode: Enum of standardized error categories.
LinkForgeError: Base exception for the entire ecosystem.
RobotModelError: Failures related to the IR and physical consistency.
RobotParserError: Failures during format import and resolution.
RobotGeneratorError: Failures during format export.
- class linkforge.core.exceptions.ValidationErrorCode(*values)[source]ο
Bases:
StrEnumCategorized error codes for robot validation failures.
- INVALID_NAME = 'invalid_name'ο
- DUPLICATE_NAME = 'duplicate_name'ο
- NAME_EMPTY = 'name_empty'ο
- NOT_FOUND = 'not_found'ο
- HAS_CYCLE = 'has_cycle'ο
- NO_ROOT = 'no_root'ο
- MULTIPLE_ROOTS = 'multiple_roots'ο
- OUT_OF_RANGE = 'out_of_range'ο
- VALUE_EMPTY = 'value_empty'ο
- INVALID_VALUE = 'invalid_value'ο
- PHYSICS_VIOLATION = 'physics_violation'ο
- INERTIA_TRIANGLE_INEQUALITY = 'inertia_triangle_inequality'ο
- MESH_UNWELDED = 'mesh_unwelded'ο
- MESH_DUPLICATE_FACE = 'mesh_duplicate_face'ο
- MESH_DEGENERATE = 'mesh_degenerate'ο
- MESH_BOUNDARY_EDGE = 'mesh_boundary_edge'ο
- MESH_NON_MANIFOLD = 'mesh_non_manifold'ο
- MESH_INCONSISTENT_WINDING = 'mesh_inconsistent_winding'ο
- MESH_SLIVER = 'mesh_sliver'ο
- GENERIC_FAILURE = 'generic_failure'ο
- exception linkforge.core.exceptions.LinkForgeError[source]ο
Bases:
ExceptionBase category for all LinkForge-related exceptions.
- exception linkforge.core.exceptions.RobotModelError[source]ο
Bases:
LinkForgeErrorException raised for structural or logic errors in the Robot model.
- exception linkforge.core.exceptions.RobotGeneratorError[source]ο
Bases:
LinkForgeErrorException raised during robot generation or export.
- exception linkforge.core.exceptions.RobotParserError[source]ο
Bases:
LinkForgeErrorException raised during robot parsing or import.
- exception linkforge.core.exceptions.RobotParserIOError(filepath='unknown', reason='error')[source]ο
Bases:
RobotParserErrorException raised for file-level or I/O errors during parsing.
- exception linkforge.core.exceptions.RobotParserXMLRootError(actual_tag='unknown', expected_tag='robot')[source]ο
Bases:
RobotParserErrorException raised when the XML root element is invalid.
- exception linkforge.core.exceptions.RobotParserUnexpectedError(source_area='unknown', original_error=None)[source]ο
Bases:
RobotParserErrorGeneral wrapper for unexpected parsing failures.
- exception linkforge.core.exceptions.RobotPhysicsError(code, message, target=None, value=None)[source]ο
Bases:
RobotModelErrorException raised for unphysical properties (e.g. negative mass or volume).
- Parameters:
code (
ValidationErrorCode)message (
str)value (
Any)
- exception linkforge.core.exceptions.RobotValidationError(code, message, target=None, value=None)[source]ο
Bases:
RobotModelErrorException raised for structural or logic validation failures.
Now structured using ValidationErrorCode for robust error handling.
- Parameters:
code (
ValidationErrorCode)message (
str)value (
Any)
- exception linkforge.core.exceptions.RobotSecurityError(path='unknown', reason='violation')[source]ο
Bases:
RobotModelErrorException raised for security-related errors (e.g. sandbox escapes).
- exception linkforge.core.exceptions.RobotMathError(code, message, target=None, value=None)[source]ο
Bases:
RobotModelErrorException raised for invalid numerical values (NaN, Inf, or Out of Range).
- Parameters:
code (
ValidationErrorCode)message (
str)value (
Any)
- exception linkforge.core.exceptions.RobotXacroError(message='failure', context=None)[source]ο
Bases:
RobotParserErrorGeneral exception for XACRO resolution failures.
- exception linkforge.core.exceptions.RobotXacroRecursionError(depth='unknown', reason=None)[source]ο
Bases:
RobotXacroErrorException raised for circular dependencies or max depth in XACRO.
- exception linkforge.core.exceptions.RobotXacroExpressionError(expression='unknown', reason='error')[source]ο
Bases:
RobotXacroErrorException raised for failures in XACRO math or property evaluation.