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
/// Contains all possible errors of the crate
#[derive(Error, Debug)]
pub enum TankerkoenigError {
    /// Something went wrong during fetching of
    /// the tankerkoenig api
    #[error("request to api failed")]
    RequestError {
        /// Error source
        #[source]
        source: reqwest::Error,
    },
    /// Something went wrong during the parsing
    /// of the tankerkoenig api response.
    #[error("Failed to parse json response: '{body}'")]
    ResponseParsingError {
        /// Response body that could not be parsed
        body: String,
    },
    /// Something went wrong during header construction
    #[error("Failed to construct http header")]
    HeaderConstruction {
        /// Error source
        #[from]
        source: reqwest::header::InvalidHeaderValue,
    },
    /// Something went wrong during http client creation
    #[error("Failed to create http client")]
    ClientConstruction {
        /// Error source
        #[source]
        source: reqwest::Error,
    },
    /// Failed to parse the request url
    #[error("Failed to construct the url")]
    UrlConstruction,
}