use crate::git::GitCommandError;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error(transparent)]
CannotFetchGitmojis(#[from] reqwest::Error),
#[error("Cannot get project config because {0}")]
CannotGetProjectConfigFile(String),
#[error("Fail to commit")]
FailToCommit,
#[error("Missing the configuration file, to create it use `gitmoji config`")]
MissingConfigFile,
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error(transparent)]
GitCommandError(#[from] GitCommandError),
#[error(transparent)]
InvalidUrlError(#[from] url::ParseError),
#[error(transparent)]
TomlSerializeError(#[from] toml_edit::ser::Error),
#[error(transparent)]
TomlDeserializeError(#[from] toml_edit::de::Error),
#[error(transparent)]
DialoguerError(#[from] dialoguer::Error),
}
pub type Result<T> = std::result::Result<T, Error>;