1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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),
}
pub type Result<T> = std::result::Result<T, Error>;