1use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum Error {
7 #[error("IO error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("TOML parse error: {0}")]
11 TomlParse(#[from] toml::de::Error),
12
13 #[error("TOML serialize error: {0}")]
14 TomlSerialize(#[from] toml::ser::Error),
15
16 #[error("JSON parse error: {0}")]
17 JsonParse(#[from] serde_json::Error),
18
19 #[error("Config not found: {0}")]
20 ConfigNotFound(String),
21
22 #[error("Invalid config: {0}")]
23 InvalidConfig(String),
24}
25
26pub type Result<T> = std::result::Result<T, Error>;