skillfile_core/error.rs
1use thiserror::Error;
2
3/// Root error type for the skillfile domain.
4///
5/// Library crates use this typed enum so callers can match on error variants.
6/// The CLI binary wraps these in `anyhow::Error` for top-level reporting.
7#[derive(Error, Debug)]
8pub enum SkillfileError {
9 #[error("{0}")]
10 Manifest(String),
11
12 #[error("{0}")]
13 Network(String),
14
15 #[error("{0}")]
16 Install(String),
17
18 #[error("{message}")]
19 PatchConflict { message: String, entry_name: String },
20
21 #[error(transparent)]
22 Io(#[from] std::io::Error),
23}
24
25/// Convenience alias used throughout the crate.
26pub type Result<T> = std::result::Result<T, SkillfileError>;