Coverage for src/loman/exception.py: 100%
19 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-21 05:36 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-21 05:36 +0000
1"""Exception classes for the loman computation engine."""
4class ComputationError(Exception):
5 """Base exception for computation-related errors."""
7 pass
10class MapError(ComputationError):
11 """Exception raised during map operations with partial results."""
13 def __init__(self, message, results):
14 """Initialize MapError with message and partial results."""
15 super().__init__(message)
16 self.results = results
19class LoopDetectedError(ComputationError):
20 """Exception raised when a dependency loop is detected."""
22 pass
25class NonExistentNodeError(ComputationError):
26 """Exception raised when trying to access a non-existent node."""
28 pass
31class NodeAlreadyExistsError(ComputationError):
32 """Exception raised when trying to create a node that already exists."""
34 pass
37class CannotInsertToPlaceholderNodeError(ComputationError):
38 """Exception raised when trying to insert into a placeholder node."""
40 pass
43# Backward compatibility aliases
44MapException = MapError
45LoopDetectedException = LoopDetectedError
46NonExistentNodeException = NonExistentNodeError
47NodeAlreadyExistsException = NodeAlreadyExistsError
48CannotInsertToPlaceholderNodeException = CannotInsertToPlaceholderNodeError