Git fork
1#[derive(Debug, Clone, PartialEq, Eq)]
2pub enum ReftableError {
3 General(String),
4 Io,
5 Format,
6 NotExist,
7 Lock,
8 Api,
9 Zlib,
10 EmptyTable,
11 Refname,
12 EntryTooBig,
13 Outdated,
14 OutOfMemory,
15}
16
17impl std::fmt::Display for ReftableError {
18 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19 match self {
20 ReftableError::General(msg) => write!(f, "general error: {}", msg),
21 ReftableError::Io => write!(f, "I/O error"),
22 ReftableError::Format => write!(f, "corrupt reftable file"),
23 ReftableError::NotExist => write!(f, "file does not exist"),
24 ReftableError::Lock => write!(f, "data is locked"),
25 ReftableError::Api => write!(f, "misuse of the reftable API"),
26 ReftableError::Zlib => write!(f, "zlib failure"),
27 ReftableError::EmptyTable => write!(f, "wrote empty table"),
28 ReftableError::Refname => write!(f, "invalid refname"),
29 ReftableError::EntryTooBig => write!(f, "entry too large"),
30 ReftableError::Outdated => write!(f, "data concurrently modified"),
31 ReftableError::OutOfMemory => write!(f, "out of memory"),
32 }
33 }
34}