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
use reqwest;
use serde_json;
use url;
use thiserror;
pub type Result<T, E = Error> = core::result::Result<T, E>;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("could not parse resource {0}")]
ResourceParseError(String),
#[error("unable to parse version in {0}")]
VersionParsing(String),
#[error("{1} while getting {0}")]
HttpError(url::Url, reqwest::StatusCode),
#[error("{0} while parsing json")]
JsonParsing(String),
#[error(transparent)]
JsonError(#[from] serde_json::Error),
#[error(transparent)]
ReqwestError(#[from] reqwest::Error),
#[error(transparent)]
UrlParseError(#[from] url::ParseError),
}