use thiserror::Error;
#[derive(Error, Debug)]
pub enum FstarError {
#[error("F* process error: {0}")]
Process(String),
#[error("F* process not found: {0}")]
FstarNotFound(String),
#[error("Protocol error: {0}")]
Protocol(String),
#[error("Configuration error: {0}")]
Config(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Query timeout after {0}ms")]
Timeout(u64),
#[error("Query cancelled")]
Cancelled,
#[error("Connection closed")]
ConnectionClosed,
#[error("Invalid position: line {line}, column {column}")]
InvalidPosition { line: u32, column: u32 },
}
pub type Result<T> = std::result::Result<T, FstarError>;