use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("HTTP error talking to Archives of Nethys: {0}")]
Http(#[from] reqwest::Error),
#[error("Archives of Nethys returned HTTP {status}")]
HttpStatus {
status: u16,
},
#[error("failed to parse Archives of Nethys response: {0}")]
Parse(#[from] serde_json::Error),
#[error("unexpected Archives of Nethys response: {0}")]
UnexpectedResponse(String),
#[error("cache error: {0}")]
Cache(#[from] rusqlite::Error),
}
pub type Result<T, E = Error> = std::result::Result<T, E>;