use thiserror::Error;
#[derive(Error, Debug)]
pub enum WaitHumanError {
#[error("Request timed out after {elapsed_seconds:.1} seconds")]
Timeout { elapsed_seconds: f64 },
#[error("Network error: {0}")]
NetworkError(#[from] reqwest::Error),
#[error("Failed to create confirmation: {status_text}")]
CreateFailed { status_text: String },
#[error("Failed to poll for answer: {status_text}")]
PollFailed { status_text: String },
#[error("Unexpected answer type: expected {expected}, got {actual}")]
UnexpectedAnswerType { expected: String, actual: String },
#[error("Invalid selected index: {index}")]
InvalidSelectedIndex { index: u32 },
#[error("Invalid response from server: {0}")]
InvalidResponse(String),
}
pub type Result<T> = std::result::Result<T, WaitHumanError>;