use std::result; use std::path::PathBuf; use thiserror::Error; #[derive(Debug, Error)] pub enum Error { #[error("The command '{0}' is not implemented")] UnimplementedCommand(String), #[error("Sqlite error: {0}")] Sqlite(#[from] rusqlite::Error), #[error("Could not find home directory :(")] NoHomeDir, #[error("The file {0} was not found")] FileNotFound(PathBuf), #[error("Error reading the file: {0}")] CouldntRead(PathBuf), #[error("Couldn't parse toml file at: {path}\nwith error: {error}")] TomlError{ path: PathBuf, error: toml::de::Error}, #[error("Couldn't parse yaml file at: {path}\nwith error: {error}")] YamlError{ path: PathBuf, error: serde_yaml::Error}, #[error("Could not parse datetime: {0}")] DateTimeParseError(#[from] chrono::format::ParseError), } pub type Result = result::Result;