1#[derive(thiserror::Error, Debug)]
2pub enum Error {
3 #[error("Invalid URL format")]
4 UrlParseError,
5
6 #[error("Error while requesting API ({0})")]
7 RequestError(#[from] ureq::Error),
8
9 #[error("Broken response from server")]
10 BadResponseEncoding,
11
12 #[error("Broken response from server: {0}")]
13 BadResponseFormat(#[from] serde_json::Error),
14
15 #[error("Failed response from server (Code {0})")]
16 FailedResponse(u16),
17
18 #[error("Other errors ({0})")]
19 Other(String),
20}
21
22pub type Result<T> = std::result::Result<T, Error>;