gix_pack/index/traverse/
error.rs

1use crate::index;
2
3/// Returned by [`index::File::traverse_with_index()`] and [`index::File::traverse_with_lookup`]
4#[derive(thiserror::Error, Debug)]
5#[allow(missing_docs)]
6pub enum Error<E: std::error::Error + Send + Sync + 'static> {
7    #[error("One of the traversal processors failed")]
8    Processor(#[source] E),
9    #[error("Index file, pack file or object verification failed")]
10    VerifyChecksum(#[from] index::verify::checksum::Error),
11    #[error("The pack delta tree index could not be built")]
12    Tree(#[from] crate::cache::delta::from_offsets::Error),
13    #[error("The tree traversal failed")]
14    TreeTraversal(#[from] crate::cache::delta::traverse::Error),
15    #[error(transparent)]
16    EntryType(#[from] crate::data::entry::decode::Error),
17    #[error("Object {id} at offset {offset} could not be decoded")]
18    PackDecode {
19        id: gix_hash::ObjectId,
20        offset: u64,
21        source: crate::data::decode::Error,
22    },
23    #[error("The packfiles checksum didn't match the index file checksum: expected {expected}, got {actual}")]
24    PackMismatch {
25        expected: gix_hash::ObjectId,
26        actual: gix_hash::ObjectId,
27    },
28    #[error("The hash of {kind} object at offset {offset} didn't match the checksum in the index file: expected {expected}, got {actual}")]
29    PackObjectMismatch {
30        expected: gix_hash::ObjectId,
31        actual: gix_hash::ObjectId,
32        offset: u64,
33        kind: gix_object::Kind,
34    },
35    #[error(
36        "The CRC32 of {kind} object at offset {offset} didn't match the checksum in the index file: expected {expected}, got {actual}"
37    )]
38    Crc32Mismatch {
39        expected: u32,
40        actual: u32,
41        offset: u64,
42        kind: gix_object::Kind,
43    },
44    #[error("Interrupted")]
45    Interrupted,
46}