use thiserror::Error;
#[derive(Error, Debug)]
pub enum FossilError {
#[error("Database error: {0}")]
Database(#[from] rusqlite::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Artifact not found: {0}")]
ArtifactNotFound(String),
#[error("Invalid artifact format: {0}")]
InvalidArtifact(String),
#[error("Decompression failed: {0}")]
Decompression(String),
#[error("Delta application failed: {0}")]
DeltaFailed(String),
#[error("Hash mismatch: expected {expected}, got {actual}")]
HashMismatch { expected: String, actual: String },
#[error("Not a heroforge repository")]
NotARepository,
#[error("Ambiguous hash prefix: {0}")]
AmbiguousHash(String),
#[error("Sync error: {0}")]
SyncError(String),
}
pub type Result<T> = std::result::Result<T, FossilError>;