use std::path::PathBuf; use thiserror::Error; /// Custom Result type for foxhunt-deploy pub(crate) type Result = std::result::Result; /// Unified error type for all operations #[derive(Error, Debug)] pub(crate) enum FoxhuntError { #[error("Configuration error: {0}")] Config(String), #[error("Config file not found at {path:?}. Run 'foxhunt-deploy init' to create one.")] ConfigNotFound { path: PathBuf }, #[error("Missing required config field: {field}")] MissingConfigField { field: String }, #[error("Docker command failed: {0}")] Docker(String), #[error("RunPod API error: {status} - {message}")] RunPodApi { status: u16, message: String }, #[error("S3 error: {0}")] S3(String), #[error("IO error: {0}")] Io(#[from] std::io::Error), #[error("HTTP request failed: {0}")] Http(#[from] reqwest::Error), #[error("Serialization error: {0}")] Serde(#[from] serde_json::Error), #[error("TOML parsing error: {0}")] Toml(#[from] toml::de::Error), #[error("Invalid argument: {0}")] InvalidArgument(String), #[error("Unknown error: {0}")] Unknown(String), }