Coverage for src/copytrading_engine/host/errors.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-11-16 16:55 +0000

1"""Typed failures raised by the engine self-test and installation store.""" 

2 

3 

4class WorkflowError(Exception): 

5 """Base for declared workflow failures safe to map at the IPC boundary.""" 

6 

7 

8class InvalidCommand(WorkflowError): 

9 """A self-test command violates a domain invariant.""" 

10 

11 

12class IdentityConflict(WorkflowError): 

13 """A command ID was reused for different canonical command content.""" 

14 

15 

16class UnsupportedSelfTest(WorkflowError): 

17 """The local deterministic parser does not support the source text.""" 

18 

19 

20class InvalidTransition(WorkflowError): 

21 """A workflow stage transition is illegal or lost its compare-and-set race.""" 

22 

23 

24class WorkflowNotFound(WorkflowError): 

25 """The requested command ID has no persisted workflow.""" 

26 

27 

28class StoreUnavailable(WorkflowError): 

29 """The durable store is unavailable or has an uncertain commit outcome.""" 

30 

31 

32class StoreClosed(WorkflowError): 

33 """The store is closing or has already been closed.""" 

34 

35 

36class InstallationAlreadyRunning(WorkflowError): 

37 """Another process currently owns this installation's engine lock.""" 

38 

39 

40class ForeignInstallation(WorkflowError): 

41 """The persisted database belongs to a different installation identity.""" 

42 

43 

44class UnknownSchemaVersion(WorkflowError): 

45 """The database schema is not known to this engine version."""