Exceptions¶
raspbot.exceptions
All exceptions raised by the raspbot library are subclasses of RaspbotError.
Hierarchy¶
RaspbotError¶
Base exception for all raspbot errors. Catch this to handle any library error in one place.
I2CError¶
Raised when an I2C read or write operation fails.
| Attribute | Description |
|---|---|
operation |
Short description of the I2C operation that failed |
cause |
The underlying exception, if any |
DeviceNotFoundError¶
Raised when the I2C device cannot be found on the bus (e.g. robot not powered on).
| Attribute | Description |
|---|---|
address |
I2C address that was not found |
bus |
Linux I2C bus number |
OLEDError¶
Raised when the OLED display cannot be initialised or driven (e.g. begin() was not called
before add_line()).
HardwareNotReadyError¶
Raised when hardware is used before it has been initialised.
Importing exceptions¶
All exceptions are also re-exported from the top-level raspbot package: