forge
ExploreLog in

Tahinli/forge

public
0 watching
★ 0
849 bytes
1//! Errors for the git layer. Converted to `forge_core::Error` at crate boundaries.
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5 #[error("io error: {0}")]
6 Io(#[from] std::io::Error),
7 #[error("git binary unusable: {0}")]
8 Unavailable(String),
9 #[error("git {found} is older than required {required}")]
10 TooOld { found: String, required: String },
11 #[error("invalid revision or path: {0}")]
12 InvalidInput(String),
13 #[error("git command failed: {0}")]
14 Failed(String),
15 /// A compare-and-swap ref update found the ref at a different value than expected.
16 #[error("ref moved since it was read: {0}")]
17 RefMoved(String),
18}
19
20pub type Result<T> = std::result::Result<T, Error>;
21
22impl From<Error> for forge_core::Error {
23 fn from(e: Error) -> Self {
24 forge_core::Error::Git(e.to_string())
25 }
26}