1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum Error {
5 #[error("Could not parse the url")]
6 InvalidUrl(#[from] url::ParseError),
7 #[error("Request failed")]
8 RequestFailed(#[from] reqwest::Error),
9 #[error("Server answered with non-ok status: {status}. body: {body}")]
10 InvalidResponse {
11 status: reqwest::StatusCode,
12 body: String,
13 },
14 #[error("Could not parse server response: {json}")]
15 ParsingFailed {
16 #[source]
17 error: serde_json::Error,
18 json: String,
19 },
20}