use serde::Deserialize;
#[non_exhaustive]
#[derive(Debug, Clone, Deserialize)]
pub struct AniListGqlError {
pub message: String,
}
#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum AniListError {
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("GraphQL errors: {}", .0.iter().map(|e| e.message.as_str()).collect::<Vec<_>>().join("; "))]
GraphQL(Vec<AniListGqlError>),
#[error("no data returned from AniList")]
NoData,
#[error("not found")]
NotFound,
}