use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Delta error: {0}")]
Delta(#[from] crate::delta::error::DeltaError),
#[error("Protocol error: {0}")]
Protocol(#[from] crate::protocol::error::ProtocolError),
#[error("peer build {peer_build} does not match this build")]
HandshakeRejected { peer_build: String },
#[error("Other error: {0}")]
Other(String),
}
pub type Result<T> = std::result::Result<T, Error>;