datasynth_group/
errors.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum GroupError {
7 #[error("config error: {0}")]
8 Config(String),
9 #[error("manifest error: {0}")]
10 Manifest(String),
11 #[error("shard error: {0}")]
12 Shard(String),
13 #[error("aggregate error: {0}")]
14 Aggregate(String),
15 #[error("io error: {0}")]
16 Io(#[from] std::io::Error),
17 #[error("serde error: {0}")]
18 Serde(String),
19}
20
21impl From<serde_yaml::Error> for GroupError {
22 fn from(e: serde_yaml::Error) -> Self {
23 Self::Serde(format!("yaml: {e}"))
24 }
25}
26
27impl From<serde_json::Error> for GroupError {
28 fn from(e: serde_json::Error) -> Self {
29 Self::Serde(format!("json: {e}"))
30 }
31}
32
33pub type GroupResult<T> = Result<T, GroupError>;