Exceptions
pychilaslasers.exceptions
PyChilasLasers exceptions module.
This module contains all custom exceptions for the PyChilasLasers library. These exceptions provide specific error handling for laser operations and modes.
Authors: SDU
Modules:
-
calibration_error–Class representing errors encountered during the reading of the calibration file.
-
laser_error–Class representing errors received from the laser.
-
mode_error–Exception class for laser mode-related errors.
Classes:
-
LaserError– -
ModeError–Exception raised for errors related to the laser mode.
Classes
LaserError(code: str, message: str)
Bases: Exception
flowchart TD
pychilaslasers.exceptions.LaserError[LaserError]
click pychilaslasers.exceptions.LaserError href "" "pychilaslasers.exceptions.LaserError"
Parameters:
-
code(str) –The error code sent by the laser. Typically a 1 but kept abstract to allow for future expansion.
-
message(str) –The error message.
-
Package Reference
Comm
Communication Functionsquery
Source code in src/pychilaslasers/exceptions/laser_error.py
8 9 10 11 12 13 14 15 16 17 18 | |
Functions
ModeError(message: str, current_mode: LaserMode | Mode, desired_mode: LaserMode | Mode | None = None)
Bases: Exception
flowchart TD
pychilaslasers.exceptions.ModeError[ModeError]
click pychilaslasers.exceptions.ModeError href "" "pychilaslasers.exceptions.ModeError"
Exception raised for errors related to the laser mode.
This exception is used to indicate that an operation cannot be performed in the current mode of the laser. It provides information about the current mode and the desired mode that would allow the operation to succeed
Parameters:
-
message(str) –The error message.
-
current_mode(LaserMode) –The current mode of the laser.
-
desired_mode(LaserMode | None, default:None) –The laser mode that would allow for the operation to succeed. Defaults to None.
Source code in src/pychilaslasers/exceptions/mode_error.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |