use crate::profile::ResolveError;
use std::path::PathBuf;
#[derive(thiserror::Error, Debug)]
pub enum PrompterError {
#[error("Failed to access {path}: {source}")]
Io {
path: PathBuf,
source: std::io::Error,
},
#[error("Write error: {0}")]
Write(std::io::Error),
#[error("$HOME not set")]
HomeNotSet,
#[error("Failed to resolve working directory: {0}")]
WorkingDir(std::io::Error),
#[error("Config path {0} has no parent directory")]
NoParentDir(PathBuf),
#[error("Invalid TOML: {0}")]
InvalidToml(#[from] toml::de::Error),
#[error("{0}")]
ConfigField(String),
#[error("{0}")]
DuplicateProfile(String),
#[error("Import cycle detected at {0}")]
ImportCycle(PathBuf),
#[error(transparent)]
Resolve(#[from] ResolveError),
#[error("{0}")]
Validation(String),
#[error("JSON serialization error: {0}")]
Json(#[from] serde_json::Error),
#[error("{0}")]
ArgParse(String),
}