#[derive(Debug, thiserror::Error)]
pub enum PapermintError {
#[error("transport error: {0}")]
Transport(String),
#[error("connection timeout after {0}ms")]
Timeout(u64),
#[error("encoding error: {0}")]
Encoding(String),
#[error("invalid command: {0}")]
InvalidCommand(String),
#[error("dialect error: {0}")]
Dialect(String),
#[error("protocol error: {0}")]
Protocol(String),
#[cfg(feature = "std")]
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[cfg(feature = "image")]
#[error("image error: {0}")]
Image(#[from] ::image::ImageError),
#[error("device not found: {0}")]
DeviceNotFound(String),
#[error("serial error: {0}")]
Serial(String),
#[error("usb error: {0}")]
Usb(String),
}
pub type Result<T> = std::result::Result<T, PapermintError>;