use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("payload too large: {size} bytes, maximum is {max}")]
PayloadTooLarge {
size: usize,
max: usize,
},
#[error("priority lane is full; the configured rate is too low for the current submit rate")]
LaneFull,
#[error("peer {0} is not connected")]
NotConnected(std::net::SocketAddr),
#[error("frame size mismatch: got {size} bytes, expected {expected}")]
FrameSizeMismatch {
size: usize,
expected: usize,
},
}