use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum SqlmapError {
#[error("API process error: {0}")]
ProcessError(#[from] std::io::Error),
#[error("binary not found: {0} — ensure python3 and sqlmap are in PATH")]
BinaryNotFound(String),
#[error("HTTP request failed: {0}")]
RequestError(#[from] reqwest::Error),
#[error("sqlmap API returned error: {0}")]
ApiError(String),
#[error("malformed JSON response structure")]
MalformedResponse,
#[error("task execution timed out after {0} seconds")]
Timeout(u64),
#[error("invalid task ID: {0}")]
InvalidTask(String),
#[error("port {port} is already in use — try a different port or use port 0 for auto-assignment")]
PortConflict {
port: u16,
},
}