gix_pack/index/write/
error.rs

1use std::io;
2
3/// Returned by [`crate::index::File::write_data_iter_to_stream()`]
4#[derive(thiserror::Error, Debug)]
5#[allow(missing_docs)]
6pub enum Error {
7    #[error("An IO error occurred when reading the pack or creating a temporary file")]
8    Io(#[from] io::Error),
9    #[error("A pack entry could not be extracted")]
10    PackEntryDecode(#[from] crate::data::input::Error),
11    #[error("Indices of type {} cannot be written, only {} are supported", *.0 as usize, crate::index::Version::default() as usize)]
12    Unsupported(crate::index::Version),
13    #[error("Ref delta objects are not supported as there is no way to look them up. Resolve them beforehand.")]
14    IteratorInvariantNoRefDelta,
15    #[error("The iterator failed to set a trailing hash over all prior pack entries in the last provided entry")]
16    IteratorInvariantTrailer,
17    #[error("Only u32::MAX objects can be stored in a pack, found {0}")]
18    IteratorInvariantTooManyObjects(usize),
19    #[error("{pack_offset} is not a valid offset for pack offset {distance}")]
20    IteratorInvariantBaseOffset { pack_offset: u64, distance: u64 },
21    #[error(transparent)]
22    Tree(#[from] crate::cache::delta::Error),
23    #[error(transparent)]
24    TreeTraversal(#[from] crate::cache::delta::traverse::Error),
25}