use crate::types::ProtocolPort;
use thiserror::Error;
pub type ProcCtlResult<T> = Result<T, ProcCtlError>;
#[derive(Error, Debug)]
pub enum ProcCtlError {
#[cfg(target_os = "linux")]
#[error("process error")]
ProcessError(#[from] procfs::ProcError),
#[cfg(any(target_os = "windows", target_os = "macos"))]
#[error("process error")]
ProcessError(String),
#[error("configuration error {0}")]
ConfigurationError(String),
#[error("too few ports, got {0:?} but expected {1}")]
TooFewPorts(Vec<ProtocolPort>, usize),
#[error("too few children, got {0} but expected {1}")]
TooFewChildren(usize, usize),
}