1use thiserror::Error;
14
15#[derive(Error, Debug)]
16pub enum GitError {
21 #[error("The `{0}` is not a valid git object type.")]
23 InvalidObjectType(String),
24
25 #[error("The `{0}` is not a valid git blob object.")]
27 InvalidBlobObject(String),
28
29 #[error("Not a valid git tree object.")]
31 InvalidTreeObject,
32
33 #[error("The `{0}` is not a valid git tree item.")]
35 InvalidTreeItem(String),
36
37 #[error("`{0}`.")]
39 EmptyTreeItems(String),
40
41 #[error("The `{0}` is not a valid git commit signature.")]
43 InvalidSignatureType(String),
44
45 #[error("Not a valid git commit object.")]
47 InvalidCommitObject,
48
49 #[error("Invalid Commit: {0}")]
51 InvalidCommit(String),
52
53 #[error("Not a valid git tag object: {0}")]
55 InvalidTagObject(String),
56
57 #[error("Not a valid git note object: {0}")]
59 InvalidNoteObject(String),
60
61 #[error("Not a valid agent context snapshot object: {0}")]
63 InvalidContextSnapshotObject(String),
64
65 #[error("Not a valid agent decision object: {0}")]
67 InvalidDecisionObject(String),
68
69 #[error("Not a valid agent evidence object: {0}")]
71 InvalidEvidenceObject(String),
72
73 #[error("Not a valid agent patch set object: {0}")]
75 InvalidPatchSetObject(String),
76
77 #[error("Not a valid agent plan object: {0}")]
79 InvalidPlanObject(String),
80
81 #[error("Not a valid agent provenance object: {0}")]
83 InvalidProvenanceObject(String),
84
85 #[error("Not a valid agent run object: {0}")]
87 InvalidRunObject(String),
88
89 #[error("Not a valid agent task object: {0}")]
91 InvalidTaskObject(String),
92
93 #[error("Not a valid agent intent object: {0}")]
95 InvalidIntentObject(String),
96
97 #[error("Not a valid agent tool invocation object: {0}")]
99 InvalidToolInvocationObject(String),
100
101 #[error("Not a valid agent context frame object: {0}")]
103 InvalidContextFrameObject(String),
104
105 #[error("The `{0}` is not a valid idx file.")]
107 InvalidIdxFile(String),
108
109 #[error("The `{0}` is not a valid pack file.")]
111 InvalidPackFile(String),
112
113 #[error("The `{0}` is not a valid pack header.")]
115 InvalidPackHeader(String),
116
117 #[error("The `{0}` is not a valid index file.")]
119 InvalidIndexFile(String),
120
121 #[error("The `{0}` is not a valid index header.")]
123 InvalidIndexHeader(String),
124
125 #[error("Argument parse failed: {0}")]
127 InvalidArgument(String),
128
129 #[error("IO Error: {0}")]
131 IOError(#[from] std::io::Error),
132
133 #[error("The {0} is not a valid Hash value ")]
135 InvalidHashValue(String),
136
137 #[error("Delta Object Error Info:{0}")]
139 DeltaObjectError(String),
140
141 #[error("The object to be packed is incomplete ,{0}")]
143 UnCompletedPackObject(String),
144
145 #[error("Error decode in the Object ,info:{0}")]
147 InvalidObjectInfo(String),
148
149 #[error("Cannot find Hash value: {0} from current file")]
151 NotFoundHashValue(String),
152
153 #[error("Can't encode the object which id [{0}] to bytes")]
155 EncodeObjectError(String),
156
157 #[error("UTF-8 conversion error: {0}")]
159 ConversionError(String),
160
161 #[error("Can't find parent tree by path: {0}")]
163 InvalidPathError(String),
164
165 #[error("Can't encode entries to pack: {0}")]
167 PackEncodeError(String),
168
169 #[error("Can't find specific object: {0}")]
171 ObjectNotFound(String),
172
173 #[error("Repository not found")]
175 RepoNotFound,
176
177 #[error("UnAuthorized: {0}")]
179 UnAuthorized(String),
180
181 #[error("Network Error: {0}")]
183 NetworkError(String),
184
185 #[error("{0}")]
187 CustomError(String),
188}