Skip to main content

adk_skill/
error.rs

1use std::path::PathBuf;
2
3#[derive(Debug, thiserror::Error)]
4pub enum SkillError {
5    #[error("io error: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("yaml parse error: {0}")]
9    Yaml(#[from] serde_yaml::Error),
10
11    #[error("invalid skill frontmatter in {path}: {message}")]
12    InvalidFrontmatter { path: PathBuf, message: String },
13
14    #[error("missing required field `{field}` in {path}")]
15    MissingField { path: PathBuf, field: &'static str },
16
17    #[error("invalid skills root, expected directory: {0}")]
18    InvalidSkillsRoot(PathBuf),
19}
20
21pub type SkillResult<T> = Result<T, SkillError>;