use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("PLANSOLVE_API_KEY environment variable is not set")]
MissingApiKey,
#[error("HTTP request failed: {0}")]
Http(#[from] reqwest::Error),
#[error("API error: status {status}, body: {body}")]
Api { status: u16, body: String },
#[error("jobId was not provided")]
MissingJobId,
#[error("solver did not finish in the allotted time")]
SolverTimeout,
#[error("invalid score format: '{0}', expected format: 'Xhard/Ymedium/Zsoft'")]
InvalidScore(String),
}