use crate::types::Epoch;
#[derive(Debug, thiserror::Error)]
pub enum KubericError {
#[error("not primary")]
NotPrimary,
#[error("no write quorum")]
NoWriteQuorum,
#[error("reconfiguration pending")]
ReconfigurationPending,
#[error("stale epoch: got {got:?}, current {current:?}")]
StaleEpoch { got: Epoch, current: Epoch },
#[error("cancelled")]
Cancelled,
#[error("closed")]
Closed,
#[error(transparent)]
Internal(#[from] Box<dyn std::error::Error + Send + Sync>),
}
pub type Result<T> = std::result::Result<T, KubericError>;