Errors
robot.errors
Custom exception hierarchy for DeskBot.
The base class :class:DeskBotError is the root of every exception raised by
this codebase. Catching it at the application boundary is the recommended way
to keep the robot alive in the face of subsystem failures.
Conventions:
- Hardware errors are non-fatal - they should be caught and reported via the event bus and the logger.
- Configuration errors are fatal at boot time.
- Programming errors (e.g. invalid state transitions) should be loud.
__all__ = ['AnimationError', 'AudioError', 'CameraError', 'ConfigurationError', 'DependencyResolutionError', 'DeskBotError', 'DisplayError', 'HardwareError', 'LLMError', 'LifecycleError', 'MicrophoneError', 'SensorError', 'ServoError', 'SpeechError', 'StateTransitionError', 'WakeWordError']
module-attribute
AnimationError
Bases: DeskBotError
An animation could not be scheduled or completed.
AudioError
Bases: HardwareError
Failure in the audio output path.
CameraError
Bases: HardwareError
Failure capturing an image from the camera.
ConfigurationError
Bases: DeskBotError
A configuration value is missing, malformed, or contradictory.
DependencyResolutionError
Bases: DeskBotError
The dependency container could not satisfy a request.
DeskBotError
DisplayError
Bases: HardwareError
Failure in a display driver (e.g. SPI write error).
HardwareError
Bases: DeskBotError
A hardware component failed, timed out, or returned invalid data.
LLMError
Bases: DeskBotError
The language model provider returned an error or timed out.
LifecycleError
Bases: DeskBotError
The application lifecycle was misused (double start, double stop, ...).
MicrophoneError
Bases: HardwareError
Failure capturing audio from the microphone.
SensorError
Bases: HardwareError
Generic sensor failure (IMU, distance, light, ...).
ServoError
Bases: HardwareError
Failure controlling a servo (e.g. PCA9685 communication error).
SpeechError
Bases: DeskBotError
Generic TTS/STT failure.
StateTransitionError
Bases: DeskBotError
An illegal state-machine transition was requested.
WakeWordError
Bases: SpeechError
Wake-word engine reported an error.