proc_status/errors.rs
1
2use {
3 thiserror::Error,
4};
5
6
7/// any error which can be raised in this crate
8///
9/// If the OS isn't compatible (ie it doesn't have
10/// a /proc pseudo file system), you'll get a
11/// ProcStatusError::Io.
12#[derive(Error, Debug)]
13pub enum ProcStatusError {
14 #[error("reading /proc file failed")]
15 Io(#[from] std::io::Error),
16 #[error("failed to parse as integer")]
17 ParseInt(#[from] std::num::ParseIntError),
18 #[error("no colon in line '{0}'")]
19 NoColon(String),
20 #[error("no entry with key '{0}'")]
21 EntryNotFound(String),
22 #[error("not a kib entry")]
23 NotInKib,
24}