#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Couldn't send request: {0}")]
FaultyRequest(#[from] reqwest::Error),
#[error("Couldn't deserialize json body: {0}")]
FailedDeserialization(#[from] serde_json::Error),
#[error("Retry using platform: {0}")]
WrongPlatform(String),
#[error("Error response from the API: {0}")]
ApiError(reqwest::StatusCode),
}
impl From<reqwest::StatusCode> for Error {
fn from(value: reqwest::StatusCode) -> Self {
Error::ApiError(value)
}
}