gitmoji_changelog/
error.rs1use std::error;
2use std::fmt;
3
4#[derive(Debug, Clone)]
5pub enum Error {
6 NoTag,
7}
8
9impl fmt::Display for Error {
10 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11 match *self {
12 Error::NoTag => write!(f, "Your repository does not seem to contain any tag. Please use the release option if you wish to generate a changelog either way.")
13 }
14 }
15}
16
17impl error::Error for Error {
18 fn description(&self) -> &str {
19 match *self {
20 Error::NoTag => "Your repository does not seem to contain any tag. Please use the release option if you wish to generate a changelog either way."
21 }
22 }
23
24 fn cause(&self) -> Option<&error::Error> {
25 None
26 }
27}