#[derive(thiserror::Error, Debug)]
pub enum CacheError {
#[error("invalid number of samples: {0}")]
InvalidCountMinWidth(u64),
#[error("invalid count main sketch width: {0}")]
InvalidSamples(usize),
#[error("invalid false positive ratio: {0}, which should be in range (0.0, 1.0)")]
InvalidFalsePositiveRatio(f64),
#[error("num_counters can't be zero")]
InvalidNumCounters,
#[error("max_cost can't be zero")]
InvalidMaxCost,
#[error("buffer_size can't be zero")]
InvalidBufferSize,
#[error("fail to send msg to channel: {0}")]
SendError(String),
#[error("fail to receive msg from channel: {0}")]
RecvError(String),
#[error("update error: {0}")]
UpdateError(String),
#[error("insert error: {0}")]
InsertError(String),
#[error("remove error: {0}")]
RemoveError(String),
#[error("cleanup error: {0}")]
CleanupError(String),
#[error("channel error: {0}")]
ChannelError(String),
}