fabro/lib/components/fabro-checkpoint/src/error.rs
2026-07-23 17:59:34 -04:00

32 lines
712 B
Rust

use std::path::PathBuf;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
Git(#[from] git2::Error),
#[error("reading file {path}: {source}")]
ReadFile {
path: PathBuf,
source: std::io::Error,
},
#[error("branch {branch} not found")]
BranchNotFound { branch: String },
}
#[derive(Debug, thiserror::Error)]
pub enum MetadataError {
#[error(transparent)]
Storage(#[from] Error),
#[error("deserialize {entity} on branch {branch}: {source}")]
Deserialize {
entity: &'static str,
branch: String,
#[source]
source: serde_json::Error,
},
}