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.

Source code in src/robot/errors.py
class AnimationError(DeskBotError):
    """An animation could not be scheduled or completed."""

AudioError

Bases: HardwareError

Failure in the audio output path.

Source code in src/robot/errors.py
class AudioError(HardwareError):
    """Failure in the audio output path."""

CameraError

Bases: HardwareError

Failure capturing an image from the camera.

Source code in src/robot/errors.py
class CameraError(HardwareError):
    """Failure capturing an image from the camera."""

ConfigurationError

Bases: DeskBotError

A configuration value is missing, malformed, or contradictory.

Source code in src/robot/errors.py
class ConfigurationError(DeskBotError):
    """A configuration value is missing, malformed, or contradictory."""

DependencyResolutionError

Bases: DeskBotError

The dependency container could not satisfy a request.

Source code in src/robot/errors.py
class DependencyResolutionError(DeskBotError):
    """The dependency container could not satisfy a request."""

DeskBotError

Bases: Exception

Base class for every exception raised by DeskBot.

Source code in src/robot/errors.py
class DeskBotError(Exception):
    """Base class for every exception raised by DeskBot."""

DisplayError

Bases: HardwareError

Failure in a display driver (e.g. SPI write error).

Source code in src/robot/errors.py
class DisplayError(HardwareError):
    """Failure in a display driver (e.g. SPI write error)."""

HardwareError

Bases: DeskBotError

A hardware component failed, timed out, or returned invalid data.

Source code in src/robot/errors.py
class HardwareError(DeskBotError):
    """A hardware component failed, timed out, or returned invalid data."""

LLMError

Bases: DeskBotError

The language model provider returned an error or timed out.

Source code in src/robot/errors.py
class LLMError(DeskBotError):
    """The language model provider returned an error or timed out."""

LifecycleError

Bases: DeskBotError

The application lifecycle was misused (double start, double stop, ...).

Source code in src/robot/errors.py
class LifecycleError(DeskBotError):
    """The application lifecycle was misused (double start, double stop, ...)."""

MicrophoneError

Bases: HardwareError

Failure capturing audio from the microphone.

Source code in src/robot/errors.py
class MicrophoneError(HardwareError):
    """Failure capturing audio from the microphone."""

SensorError

Bases: HardwareError

Generic sensor failure (IMU, distance, light, ...).

Source code in src/robot/errors.py
class SensorError(HardwareError):
    """Generic sensor failure (IMU, distance, light, ...)."""

ServoError

Bases: HardwareError

Failure controlling a servo (e.g. PCA9685 communication error).

Source code in src/robot/errors.py
class ServoError(HardwareError):
    """Failure controlling a servo (e.g. PCA9685 communication error)."""

SpeechError

Bases: DeskBotError

Generic TTS/STT failure.

Source code in src/robot/errors.py
class SpeechError(DeskBotError):
    """Generic TTS/STT failure."""

StateTransitionError

Bases: DeskBotError

An illegal state-machine transition was requested.

Source code in src/robot/errors.py
class StateTransitionError(DeskBotError):
    """An illegal state-machine transition was requested."""

WakeWordError

Bases: SpeechError

Wake-word engine reported an error.

Source code in src/robot/errors.py
class WakeWordError(SpeechError):
    """Wake-word engine reported an error."""