use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
pub enum CoreError {
#[error("could not determine home directory")]
NoHomeDir,
#[error("failed to load config from {path}: {source}")]
ConfigLoad {
path: PathBuf,
source: Box<dyn std::error::Error + Send + Sync>,
},
#[error("configuration policy rejected {path}: {reason}")]
ConfigPolicy { path: PathBuf, reason: String },
#[error("profile '{child}' extends unknown profile '{base}'")]
UnknownBaseProfile { child: String, base: String },
#[error(
"could not detect ecosystem from command '{command}' or working directory; use --profile"
)]
DetectionFailed { command: String },
#[error("sandbox backend unavailable: {reason}")]
BackendUnavailable { reason: String },
#[error("sandbox backend cannot enforce '{capability}' on this kernel: {detail}")]
BackendDegraded {
capability: &'static str,
detail: String,
},
#[error("profile lint failed: {0}")]
ProfileLint(String),
#[error("sandbox I/O: {0}")]
Io(#[from] std::io::Error),
#[error("sandbox backend error: {0}")]
Backend(String),
}