use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("Invalid paging mode option")]
InvalidPagingMode,
#[error("Configuration directory not set")]
DirectoryUnset,
#[error("Expansion of home directory in `{0}` failed")]
HomeExpansionFailed(String),
#[error("No labels found in mailbox")]
NoLabelsFound,
#[error("No rule selector specified (i.e. --id or --label)")]
NoRuleSelector,
#[error("No rule for label {0}")]
NoRuleFoundForLabel(String),
#[error("No query string calculated for rule #{0}")]
NoQueryStringCalculated(usize),
#[error("Label {0} not found in the mailbox")]
LabelNotFoundInMailbox(String),
#[error("No rule for id {0}")]
RuleNotFound(usize),
#[error("Label `{0}` not found in the rule set")]
LabelNotFoundInRules(String),
#[error("Directory creation failed for `{0:?}`")]
DirectoryCreationFailed((String, Box<std::io::Error>)),
#[error(transparent)]
GoogleGmail1(#[from] Box<google_gmail1::Error>),
#[error(transparent)]
StdIO(#[from] std::io::Error),
#[error(transparent)]
TomlDe(#[from] toml::de::Error),
#[error(transparent)]
Config(#[from] config::ConfigError),
#[error("Invalid message age: {0}")]
InvalidMessageAge(String),
#[error("Token error: {0}")]
TokenNotFound(String),
#[error("File I/O error: {0}")]
FileIo(String),
#[error("Serialization error: {0}")]
SerializationError(String),
}