1use miette::Diagnostic;
4
5#[non_exhaustive]
7#[derive(Debug, thiserror::Error, Diagnostic)]
8pub enum GitBridgeError {
9 #[error("git error: {0}")]
11 Git(#[from] git2::Error),
12
13 #[error("vcs error: {0}")]
15 Vcs(#[from] panproto_vcs::VcsError),
16
17 #[error("project error: {0}")]
19 Project(#[from] panproto_project::ProjectError),
20
21 #[error("parse error: {0}")]
23 Parse(#[from] panproto_parse::ParseError),
24
25 #[error("repository has no commits")]
27 EmptyRepository,
28
29 #[error("failed to read git object {oid}: {reason}")]
31 ObjectRead {
32 oid: String,
34 reason: String,
36 },
37
38 #[error("file {path} is not valid UTF-8")]
40 NotUtf8 {
41 path: String,
43 },
44}