#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("no blink(1) device found")]
NotFound,
#[error("invalid color: {0}")]
BadColor(String),
#[error("pattern position {pos} out of range (device holds {max} lines)")]
PatternPos {
pos: u8,
max: u8,
},
#[error("device returned an unexpected response")]
BadResponse,
#[error("{op} is not supported on {kind}")]
Unsupported {
op: &'static str,
kind: crate::DeviceKind,
},
#[error("watchdog_tickle called before watchdog_enable")]
WatchdogNotArmed,
#[error("USB HID error: {0}")]
Hid(#[from] hidapi::HidError),
}
pub type Result<T> = std::result::Result<T, Error>;