terminal_velocity/
errors.rs1use std::path::PathBuf;
2
3#[derive(thiserror::Error, Debug)]
4pub enum Error {
5 #[error("Directory not found: {0}")]
6 DirectoryNotFound(PathBuf),
7
8 #[error("Required directory missing: {0}")]
9 MissingDirectory(String),
10
11 #[error("IO error: {0}")]
12 Io(#[from] std::io::Error),
13
14 #[error("Template error: {0}")]
15 Template(#[from] tera::Error),
16
17 #[error("Frontmatter error in {file}: {message}")]
18 Frontmatter { file: String, message: String },
19
20 #[error("Server error: {0}")]
21 Server(#[from] Box<dyn std::error::Error>),
22
23 #[error("Configuration parse error: {0}")]
24 ConfigParse(String),
25
26 #[error("API error: {0}")]
27 Api(String),
28
29 #[error("Missing API key. Set ANTHROPIC_API_KEY environment variable or use --anthropic-key")]
30 MissingApiKey,
31
32 #[error("Git error: {0}")]
33 Git(#[from] git2::Error),
34
35 #[error("TOML error: {0}")]
36 Toml(#[from] toml::de::Error),
37
38 #[error("TOML serialization error: {0}")]
39 TomlSer(#[from] toml::ser::Error),
40
41 #[error(transparent)]
42 Other(#[from] Box<dyn std::error::Error + Send + Sync>),
43}