1use crate::types::Epoch;
2
3#[derive(Debug, thiserror::Error)]
4pub enum KubericError {
5 #[error("not primary")]
7 NotPrimary,
8
9 #[error("no write quorum")]
11 NoWriteQuorum,
12
13 #[error("reconfiguration pending")]
15 ReconfigurationPending,
16
17 #[error("stale epoch: got {got:?}, current {current:?}")]
19 StaleEpoch { got: Epoch, current: Epoch },
20
21 #[error("cancelled")]
23 Cancelled,
24
25 #[error("closed")]
27 Closed,
28
29 #[error(transparent)]
31 Internal(#[from] Box<dyn std::error::Error + Send + Sync>),
32}
33
34pub type Result<T> = std::result::Result<T, KubericError>;