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
#[derive(Debug)]
pub enum ClientError {
RateLimit,
Unauthorized,
InternalServerError,
HttpError(reqwest::Error),
ApiKeyInvalid(reqwest::header::InvalidHeaderValue)
}
impl From<reqwest::Error> for ClientError {
fn from(error: reqwest::Error) -> Self {
ClientError::HttpError(error)
}
}
impl From<reqwest::header::InvalidHeaderValue> for ClientError {
fn from(error: reqwest::header::InvalidHeaderValue) -> Self {
ClientError::ApiKeyInvalid(error)
}
}