1use std::path::PathBuf;
4use thiserror::Error;
5
6pub type Result<T> = std::result::Result<T, Error>;
8
9#[derive(Debug, Error)]
11pub enum Error {
12 #[error("Config error: {0}")]
13 Config(String),
14
15 #[error("Config not found. Searched: {searched:?}")]
16 ConfigNotFound { searched: Vec<PathBuf> },
17
18 #[error("Failed to parse config at {path}: {source}")]
19 ConfigParse {
20 path: PathBuf,
21 #[source]
22 source: toml::de::Error,
23 },
24
25 #[error("Content error at {path}: {message}")]
26 Content { path: PathBuf, message: String },
27
28 #[error("Post not found: {0}")]
29 PostNotFound(String),
30
31 #[error("Series not found: {0}")]
32 SeriesNotFound(String),
33
34 #[error("Storage error: {0}")]
35 Storage(String),
36
37 #[error("Git error: {0}")]
38 Git(String),
39
40 #[error("IO error: {0}")]
41 Io(#[from] std::io::Error),
42
43 #[error("S3 error: {0}")]
44 S3(String),
45}