1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum Error {
6 #[error("Invalid paging mode option")]
8 InvalidPagingMode,
9 #[error("Configuration directory not set")]
11 DirectoryUnset,
12 #[error("Expansion of home directory in `{0}` failed")]
14 HomeExpansionFailed(String),
15 #[error("No rule selector specified (i.e. --id or --label)")]
17 NoRuleSelector,
18 #[error("No rule for label {0}")]
20 NoRuleFoundForLabel(String),
21 #[error("No query string calculated for rule #{0}")]
23 NoQueryStringCalculated(usize),
24 #[error("Label {0} not found in the mailbox")]
26 LabelNotFoundInMailbox(String),
27 #[error("No rule for id {0}")]
29 RuleNotFound(usize),
30 #[error("Label `{0}` not found in the rule set")]
32 LabelNotFoundInRules(String),
33 #[error("Directory creation failed for `{0:?}`")]
35 DirectoryCreationFailed((String, Box<std::io::Error>)),
36 #[error(transparent)]
38 GoogleGmail1(#[from] Box<google_gmail1::Error>),
39 #[error(transparent)]
41 StdIO(#[from] std::io::Error),
42 #[error(transparent)]
44 TomlDe(#[from] toml::de::Error),
45}