1use gix_object::bstr::BString;
2
3#[derive(Debug, thiserror::Error)]
5#[allow(missing_docs)]
6pub enum Error {
7 #[error("No commit was given")]
8 EmptyTraversal,
9 #[error(transparent)]
10 BlobDiffSetResource(#[from] gix_diff::blob::platform::set_resource::Error),
11 #[error(transparent)]
12 BlobDiffPrepare(#[from] gix_diff::blob::platform::prepare_diff::Error),
13 #[error("The file to blame at '{file_path}' wasn't found in the first commit at {commit_id}")]
14 FileMissing {
15 file_path: BString,
17 commit_id: gix_hash::ObjectId,
19 },
20 #[error("Couldn't find commit or tree in the object database")]
21 FindObject(#[from] gix_object::find::Error),
22 #[error("Could not find existing blob or commit")]
23 FindExistingObject(#[from] gix_object::find::existing_object::Error),
24 #[error("Could not find existing iterator over a tree")]
25 FindExistingIter(#[from] gix_object::find::existing_iter::Error),
26 #[error("Failed to obtain the next commit in the commit-graph traversal")]
27 Traverse(#[source] Box<dyn std::error::Error + Send + Sync>),
28 #[error(transparent)]
29 DiffTree(#[from] gix_diff::tree::Error),
30 #[error("Invalid line range was given, line range is expected to be a 1-based inclusive range in the format '<start>,<end>'")]
31 InvalidLineRange,
32}