1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

use {
    thiserror::Error,
};


/// any error which can be raised in this crate
///
/// If the OS isn't compatible (ie it doesn't have
/// a /proc pseudo file system), you'll get a
/// ProcStatusError::Io.
#[derive(Error, Debug)]
pub enum ProcStatusError {
    #[error("reading /proc file failed")]
    Io(#[from] std::io::Error),
    #[error("failed to parse as integer")]
    ParseInt(#[from] std::num::ParseIntError),
    #[error("no colon in line '{0}'")]
    NoColon(String),
    #[error("no entry with key '{0}'")]
    EntryNotFound(String),
    #[error("not a kib entry")]
    NotInKib,
}