1use crate::types::ProtocolPort;
2use thiserror::Error;
3
4pub type ProcCtlResult<T> = Result<T, ProcCtlError>;
6
7#[derive(Error, Debug)]
9pub enum ProcCtlError {
10 #[cfg(target_os = "linux")]
12 #[error("process error")]
13 ProcessError(#[from] procfs::ProcError),
14
15 #[cfg(any(target_os = "windows", target_os = "macos"))]
17 #[error("process error")]
18 ProcessError(String),
19
20 #[error("configuration error {0}")]
22 ConfigurationError(String),
23
24 #[error("too few ports, got {0:?} but expected {1}")]
26 TooFewPorts(Vec<ProtocolPort>, usize),
27
28 #[error("too few children, got {0} but expected {1}")]
30 TooFewChildren(usize, usize),
31}