use thiserror::Error;
pub type Result<T> = std::result::Result<T, ProcjailError>;
#[derive(Debug, Error)]
pub enum ProcjailError {
#[error("{0}. Fix: verify the runtime binary, harness path, work directory, and any config file paths exist and are readable on this host.")]
Io(#[from] std::io::Error),
#[error("failed to parse procjail TOML configuration: {0}. Fix: keep settings at the top level, for example `runtime_path = \"node\"` and `timeout_seconds = 30`.")]
TomlDe(#[from] toml::de::Error),
#[error("{0}. Fix: verify the runtime path, containment strategy, harness file, and working directory before retrying.")]
Message(String),
#[error("procjail operation failed: {0}. Fix: verify the runtime path, containment strategy, harness file, and working directory before retrying.")]
Anyhow(#[from] anyhow::Error),
}