use thiserror::Error;
#[derive(Error, Debug)]
pub enum DoclingError {
#[error("http error: {0}")]
Http(#[from] reqwest::Error),
#[error("api error (HTTP {status_code}): {body}")]
Api { status_code: u16, body: String },
#[error("json deserialization error: {0}")]
Json(#[from] serde_json::Error),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("task {task_id} failed with status: {status}")]
TaskFailed { task_id: String, status: String },
#[error("task {task_id} timed out after {elapsed_secs:.1}s")]
Timeout { task_id: String, elapsed_secs: f64 },
}