"""Module for fand exceptions"""
[docs]class FandError(Exception):
"""Base class for all exceptions in fand"""
[docs]class TerminatingError(FandError):
"""Daemon is terminating"""
# Communication related errors
[docs]class CommunicationError(FandError):
"""Base class for communication related errors"""
[docs]class SendReceiveError(CommunicationError, ConnectionError):
"""Error while sending or receiving data"""
[docs]class ListeningError(CommunicationError, ConnectionError):
"""Error when listening to clients"""
[docs]class ConnectionFailedError(CommunicationError, ConnectionError):
"""Cannot connect to given address and port"""
[docs]class CorruptedDataError(CommunicationError, ConnectionError):
"""Invalid data received"""
[docs]class FandConnectionResetError(CommunicationError, ConnectionResetError):
"""Connection reset"""
[docs]class FandTimeoutError(CommunicationError, TimeoutError):
"""Connection timed out"""
[docs]class UnpicklableError(CommunicationError, ValueError):
"""Given value cannot be pickled"""
# Shelf related errors
[docs]class ShelfTemperatureBadValue(FandError, ValueError):
"""Temperatures given for shelf are invalid"""
[docs]class ShelfRpmBadValue(FandError, ValueError):
"""RPM value is invalid"""
[docs]class ShelfPwmBadValue(FandError, ValueError):
"""PWM value is invalid"""
[docs]class ShelfPwmExpireBadValue(FandError, ValueError):
"""PWM override expiration date is invalid"""
[docs]class ShelfNotFoundError(FandError, ValueError):
"""Given shelf name is unknown"""
# Server and client related errors
[docs]class ServerNoConfigError(FandError, FileNotFoundError):
"""No configuration file found"""
[docs]class GpioError(FandError):
"""Any GPIO related errors"""
[docs]class FanctlActionBadValue(FandError, ValueError):
"""No action found with this name and parameters"""