Source code for ekfsm.exceptions

from enum import Enum


[docs] class EkfSmException(Exception): """Base class for all exceptions in the EKFSM Library""" pass
[docs] class ConfigError(EkfSmException): """Error in configuration""" pass
[docs] class SYSFSError(EkfSmException): """Error while handling sysfs pseudo file system""" pass
[docs] class GPIOError(EkfSmException): """Error while handling GPIO"""
[docs] class ErrorType(Enum): INVALID_PIN = "Pin not found" NO_MATCHING_DEVICE = "No matching device found" NO_MAJOR_MINOR = "No major/minor number found"
pass def __init__(self, error_type: ErrorType, details: str | None = None): self.error_type = error_type self.details = details super().__init__( f"{error_type.value}: {details}" if details else error_type.value )
[docs] class FirmwareNodeError(EkfSmException): """Error while handlig firmware node""" pass
[docs] class DataCorruptionError(EkfSmException): """Error while handling data corruption""" def __init__(self, details: str | None = None): self.details = details super().__init__( f"Data corruption: {details}" if details else "Data corruption" )
[docs] class AcquisitionError(EkfSmException): """Error while handling data acquisition""" pass