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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

//! GitHub v3 REST API
//! 
//! 1.1.4
//! 
//! GitHub's v3 REST API.
//! 
//! [GitHub v3 REST API](https://docs.github.com/rest/)

use thiserror::Error;

mod support;

pub mod config;
pub mod request;
pub mod schema;

#[cfg(feature = "hyper")]
pub mod hyper;

#[cfg(feature = "reqwest")]
pub mod reqwest;

#[derive(Error, Debug)]
pub enum ApiError {
    #[cfg(feature = "hyper")]
    #[error("Hyper error")]
    Hyper {
        #[from]
        source: ::hyper::Error,
    },

    #[cfg(feature = "reqwest")]
    #[error("Reqwest error")]
    Reqwest {
        #[from]
        source: ::reqwest::Error,
    },

    #[cfg(feature = "reqwest")]
    #[error("URL parse error")]
    UrlParser {
        #[from]
        source: ::url::ParseError,
    },

    #[error("AuthenticError")]
    Authentic {
        #[from]
        source: ::authentic::AuthenticError,
    },

    #[error("QuerylizerError")]
    Querylizer {
        #[from]
        source: ::querylizer::QuerylizerError,
    },

    #[error("InvalidHeaderValue")]
    InvalidHeaderValue {
        #[from]
        source: ::hyper::header::InvalidHeaderValue,
    },
    #[error("HttpError")]
    Http {
        #[from]
        source: ::http::Error,
    },
    #[error("JsonSerializationError")]
    JsonSerializationError {
        #[from]
        source: ::serde_json::error::Error,
    },
    #[error("FormatError")]
    Format {
        #[from]
        source: ::std::fmt::Error,
    },
    #[error("{0}")]
    Other(String),
}