use thiserror::Error; #[derive(Debug, Error)] pub enum MirrorError { #[error("git error: {0}")] Git(String), #[error("NATS error: {0}")] Nats(String), #[error("json error: {0}")] Json(#[from] serde_json::Error), #[error("io error: {0}")] Io(#[from] std::io::Error), } impl From for MirrorError { fn from(e: git2::Error) -> Self { MirrorError::Git(e.to_string()) } }