talos_skill/error.rs
1use std::path::PathBuf;
2use thiserror::Error;
3
4/// Errors that can occur during skill loading.
5#[derive(Debug, Error)]
6pub enum SkillError {
7 /// An I/O error occurred while reading a file or directory.
8 #[error("I/O error: {0}")]
9 IoError(#[from] std::io::Error),
10
11 /// The YAML frontmatter could not be parsed.
12 #[error("YAML parse error: {0}")]
13 YamlParseError(#[from] serde_yaml::Error),
14
15 /// The frontmatter is missing required fields or is malformed.
16 #[error("invalid frontmatter: {0}")]
17 InvalidFrontmatter(String),
18
19 /// The specified skill file was not found.
20 #[error("file not found: {0}")]
21 FileNotFound(PathBuf),
22}
23
24/// Result type alias for skill operations.
25pub type Result<T, E = SkillError> = std::result::Result<T, E>;