use std::error::Error;
use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ChannelError {
#[error("the HID channel implementation returned an error")]
Implementation(#[from] Box<dyn Error + Sync + Send>),
#[error("the report descriptor could not be parsed")]
ReportDescriptor(hidreport::ParserError),
#[error("the HID channel does not support HID++")]
HidppNotSupported,
#[error("the channel does not support the given HID++ message type")]
MessageTypeNotSupported,
#[error("raw HID reports must contain 1..=64 bytes, got {0}")]
InvalidRawReportLength(usize),
#[error("the device did not respond to the request")]
NoResponse,
#[error("the HID channel operation timed out")]
Timeout,
}