#[non_exhaustive]pub enum ReftableError {
Show 19 variants
TooSmall {
len: usize,
},
BadMagic,
UnsupportedVersion {
version: u8,
},
FooterVersionMismatch {
header: u8,
footer: u8,
},
FooterChecksumMismatch {
stored: u32,
computed: u32,
},
Truncated {
field: ReftableField,
},
InvalidUtf8 {
field: ReftableField,
},
PrefixTooLong {
field: ReftableField,
},
UnknownValueType {
value_type: u8,
},
InvalidBlockLength,
InvalidRestartTable,
InvalidLogKey,
MissingTable {
name: String,
},
UnsortedRefs {
previous: String,
next: String,
},
EntryTooLarge,
EmptyRecordKey,
Locked {
lock_path: PathBuf,
},
LockReleased,
ExpectedMismatch {
refname: String,
expected: ObjectId,
actual: Option<ObjectId>,
},
}Expand description
A reftable failure: malformed table bytes, a locked stack, or a rejected update.
Wrapped by Error::Reftable. Corruption variants describe what was wrong
with the bytes; Self::Locked and Self::ExpectedMismatch are the
conditions callers usually want to react to (retry, or re-read and redo).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooSmall
The file is shorter than its header and footer require.
BadMagic
The header or footer does not start with the REFT magic.
UnsupportedVersion
The header names a format version other than 1 (SHA-1) or 2 (SHA-256).
The footer repeats a different version than the header.
The footer’s CRC-32 does not match its contents.
Truncated
The data ends inside a field.
Fields
field: ReftableFieldField that was cut short.
InvalidUtf8
A text field is not valid UTF-8.
Fields
field: ReftableFieldField holding the invalid bytes.
PrefixTooLong
A prefix-compressed key claims more shared bytes than the previous key has.
Fields
field: ReftableFieldKey whose prefix length is out of range.
UnknownValueType
A ref record uses a value type outside the format’s four kinds.
InvalidBlockLength
A block’s length points outside the file.
InvalidRestartTable
A block’s restart table is out of range or overlaps its records.
InvalidLogKey
A log record key lacks the refname NUL update_index layout.
MissingTable
tables.list names a table that is not part of the loaded stack.
UnsortedRefs
ReftableWriter::add_ref was called out of name order.
Fields
EntryTooLarge
A record does not fit in an empty block of the configured size.
EmptyRecordKey
A record with an empty key was written.
Locked
Another writer holds tables.list.lock.
LockReleased
The tables.list.lock guard was used after its lock had been committed.
ExpectedMismatch
A compare-and-swap update found a different value than it required.
Trait Implementations§
Source§impl Debug for ReftableError
impl Debug for ReftableError
Source§impl Display for ReftableError
impl Display for ReftableError
Source§impl Error for ReftableError
impl Error for ReftableError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()