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 still running after the client's poll budget elapsed (max_attempts × poll_interval); raise --max-attempts / --poll-interval, or bound the solve with `options.spentLimit` in the request so it converges sooner")]
SolverTimeout,
#[error("invalid score format: '{0}', expected format: 'Xhard/Ymedium/Zsoft'")]
InvalidScore(String),
}