gix_pack/index/traverse/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::index;

/// Returned by [`index::File::traverse_with_index()`] and [`index::File::traverse_with_lookup`]
#[derive(thiserror::Error, Debug)]
#[allow(missing_docs)]
pub enum Error<E: std::error::Error + Send + Sync + 'static> {
    #[error("One of the traversal processors failed")]
    Processor(#[source] E),
    #[error("Index file, pack file or object verification failed")]
    VerifyChecksum(#[from] index::verify::checksum::Error),
    #[error("The pack delta tree index could not be built")]
    Tree(#[from] crate::cache::delta::from_offsets::Error),
    #[error("The tree traversal failed")]
    TreeTraversal(#[from] crate::cache::delta::traverse::Error),
    #[error(transparent)]
    EntryType(#[from] crate::data::entry::decode::Error),
    #[error("Object {id} at offset {offset} could not be decoded")]
    PackDecode {
        id: gix_hash::ObjectId,
        offset: u64,
        source: crate::data::decode::Error,
    },
    #[error("The packfiles checksum didn't match the index file checksum: expected {expected}, got {actual}")]
    PackMismatch {
        expected: gix_hash::ObjectId,
        actual: gix_hash::ObjectId,
    },
    #[error("The hash of {kind} object at offset {offset} didn't match the checksum in the index file: expected {expected}, got {actual}")]
    PackObjectMismatch {
        expected: gix_hash::ObjectId,
        actual: gix_hash::ObjectId,
        offset: u64,
        kind: gix_object::Kind,
    },
    #[error(
        "The CRC32 of {kind} object at offset {offset} didn't match the checksum in the index file: expected {expected}, got {actual}"
    )]
    Crc32Mismatch {
        expected: u32,
        actual: u32,
        offset: u64,
        kind: gix_object::Kind,
    },
    #[error("Interrupted")]
    Interrupted,
}