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
« prev ^ index » next coverage.py v7.6.1, created at 2026-06-16 18:30 +0000
1"""Custom exception classes for GUI application.
3This module defines a hierarchy of exceptions specific to the pytribeam GUI,
4making it easier to catch and handle specific error conditions.
5"""
8class TriBeamGUIError(Exception):
9 """Base exception for all GUI-related errors.
11 All custom GUI exceptions should inherit from this class, allowing
12 for broad exception catching when needed.
13 """
15 pass
18class ConfigurationError(TriBeamGUIError):
19 """Raised when configuration file operations fail.
21 This includes errors in:
22 - Loading configuration files
23 - Parsing YAML
24 - Invalid configuration structure
25 - Missing required configuration fields
26 """
28 pass
31class MicroscopeConnectionError(TriBeamGUIError):
32 """Raised when microscope connection operations fail.
34 This includes errors in:
35 - Establishing connection to microscope
36 - Communication with microscope
37 - Microscope API errors
38 """
40 pass
43class ValidationError(TriBeamGUIError):
44 """Raised when configuration validation fails.
46 This includes errors in:
47 - Schema validation
48 - Parameter range validation
49 - Step configuration validation
50 """
52 pass
55class ResourceError(TriBeamGUIError):
56 """Raised when required resources are missing or inaccessible.
58 This includes errors in:
59 - Missing image/icon files
60 - Inaccessible documentation
61 - File permission issues
62 """
64 pass
67class ExperimentError(TriBeamGUIError):
68 """Raised when experiment execution encounters errors.
70 This includes errors in:
71 - Step execution failures
72 - Stage movement errors
73 - Imaging errors
74 """
76 pass
79class ThreadError(TriBeamGUIError):
80 """Raised when thread management operations fail.
82 This includes errors in:
83 - Thread creation
84 - Thread stopping
85 - Thread exception injection
86 """
88 pass