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
use std::{
    error::Error,
    fmt::{Debug, Display, Formatter},
};

#[cfg(feature = "octocrab")]
mod for_octocrab;
mod for_reqwest;
mod for_serde_json;

#[derive(Debug, Clone)]
pub enum GithubError {
    NetworkError(String),
    RuntimeError(String),
    UnknownError,
}

impl Display for GithubError {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        Debug::fmt(self, f)
    }
}

impl Error for GithubError {}

pub type Result<T = ()> = std::result::Result<T, GithubError>;