#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum DriverError {
#[error("datagram I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("transport/session error: {0}")]
Transport(#[from] matter_transport::Error),
#[error("crypto handshake error: {0}")]
Crypto(#[from] matter_crypto::Error),
#[error("interaction-model framing error: {0}")]
Im(#[from] crate::im::ImError),
#[error("commissioning state-machine error: {0}")]
Commissioning(#[from] crate::CommissioningError),
#[error("device discovery failed: {0}")]
Discovery(String),
#[error("retransmit budget exhausted on exchange {exchange_id}")]
Timeout {
exchange_id: u16,
},
#[error("handshake protocol error: {0}")]
Handshake(&'static str),
#[error("expected unsecured (session-id 0) message, got session id {0}")]
UnexpectedSecuredMessage(u16),
#[error(
"session establishment rejected: general code {general_code}, \
protocol code {protocol_code:#06x}"
)]
SessionEstablishmentFailed {
general_code: u16,
protocol_code: u16,
},
#[error("commissioning aborted: {0}")]
Aborted(String),
#[error("chunked read exceeded its bound: {limit}")]
ReadTooLarge {
limit: &'static str,
},
}