use thiserror::Error;
#[derive(Debug, Error)]
pub enum DecodeError {
#[error(transparent)]
IO(#[from] std::io::Error),
#[error(
"The decoded value {0} does not fit into the usize type of this \
architecture"
)]
OutsideUsizeRange(u64),
#[error("An array has too many elements: {0}")]
ArrayTooBig(usize),
#[error("TODO {0}")]
UnknownEnumVariant(u8),
}
#[derive(Debug, Error)]
pub enum EncodeError {
#[error(transparent)]
IO(#[from] std::io::Error),
#[error("The usize value {0} does not fit into the u32 range of values.")]
OutsideU32Range(usize),
#[error("An array has too many elements: {0}")]
ArrayTooBig(usize),
}