use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum GrindrError {
#[error("HTTP error: {0}")]
Http(String),
#[error("auth error: {0}")]
Auth(String),
#[error("API error {code}: {message}")]
Api {
code: i32,
message: String,
},
#[error("unauthorized ({code}): {message}")]
Unauthorized {
code: i32,
message: String,
},
#[error("invalid request: {0}")]
InvalidRequest(String),
}
impl From<wreq::Error> for GrindrError {
fn from(e: wreq::Error) -> Self {
GrindrError::Http(e.to_string())
}
}