Coverage for src/pytribeam/GUI/common/errors.py: 0%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2026-06-16 18:30 +0000

1"""Custom exception classes for GUI application. 

2 

3This module defines a hierarchy of exceptions specific to the pytribeam GUI, 

4making it easier to catch and handle specific error conditions. 

5""" 

6 

7 

8class TriBeamGUIError(Exception): 

9 """Base exception for all GUI-related errors. 

10 

11 All custom GUI exceptions should inherit from this class, allowing 

12 for broad exception catching when needed. 

13 """ 

14 

15 pass 

16 

17 

18class ConfigurationError(TriBeamGUIError): 

19 """Raised when configuration file operations fail. 

20 

21 This includes errors in: 

22 - Loading configuration files 

23 - Parsing YAML 

24 - Invalid configuration structure 

25 - Missing required configuration fields 

26 """ 

27 

28 pass 

29 

30 

31class MicroscopeConnectionError(TriBeamGUIError): 

32 """Raised when microscope connection operations fail. 

33 

34 This includes errors in: 

35 - Establishing connection to microscope 

36 - Communication with microscope 

37 - Microscope API errors 

38 """ 

39 

40 pass 

41 

42 

43class ValidationError(TriBeamGUIError): 

44 """Raised when configuration validation fails. 

45 

46 This includes errors in: 

47 - Schema validation 

48 - Parameter range validation 

49 - Step configuration validation 

50 """ 

51 

52 pass 

53 

54 

55class ResourceError(TriBeamGUIError): 

56 """Raised when required resources are missing or inaccessible. 

57 

58 This includes errors in: 

59 - Missing image/icon files 

60 - Inaccessible documentation 

61 - File permission issues 

62 """ 

63 

64 pass 

65 

66 

67class ExperimentError(TriBeamGUIError): 

68 """Raised when experiment execution encounters errors. 

69 

70 This includes errors in: 

71 - Step execution failures 

72 - Stage movement errors 

73 - Imaging errors 

74 """ 

75 

76 pass 

77 

78 

79class ThreadError(TriBeamGUIError): 

80 """Raised when thread management operations fail. 

81 

82 This includes errors in: 

83 - Thread creation 

84 - Thread stopping 

85 - Thread exception injection 

86 """ 

87 

88 pass