#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Generic error: {0}")]
Generic(String),
#[error("Static error: {0}")]
Static(&'static str),
#[error(transparent)]
IO(#[from] std::io::Error),
#[error("Invalid Id size, expected 20, got {0}")]
InvalidIdSize(usize),
#[error("Invalid Id encoding: {0}")]
InvalidIdEncoding(String),
#[error("Failed to parse packet bytes: {0}")]
BencodeError(#[from] serde_bencode::Error),
#[error("Invalid transaction_id: {0:?}")]
InvalidTransactionId(Vec<u8>),
#[error(transparent)]
Receive(#[from] flume::RecvError),
#[error("Invalid mutable item signature")]
InvalidMutableSignature,
#[error("Invalid mutable item public key")]
InvalidMutablePublicKey,
}