amdmond_lib/
errors.rs

1use amdgpu::utils;
2use amdgpu_config::{fan, monitor};
3
4#[derive(Debug, thiserror::Error)]
5pub enum AmdMonError {
6    #[error("Mon AMD GPU card was found")]
7    NoHwMon,
8    #[error("Failed to access {path:?}. {io}")]
9    Io { io: std::io::Error, path: String },
10    #[error("{0}")]
11    MonConfigError(#[from] monitor::ConfigError),
12    #[error("{0}")]
13    FanConfigError(#[from] fan::ConfigError),
14    #[error("{0}")]
15    AmdUtils(#[from] utils::AmdGpuError),
16    #[error("{0}")]
17    Csv(#[from] csv::Error),
18    #[error("AMD GPU temperature is malformed. It should be number. {0:?}")]
19    NonIntTemp(std::num::ParseIntError),
20    #[error("AMD GPU fan speed is malformed. It should be number. {0:?}")]
21    NonIntPwm(std::num::ParseIntError),
22    #[error("Monitor format is not valid. Available values are: short, s, long l, verbose and v")]
23    InvalidMonitorFormat,
24    #[error("Failed to read AMD GPU temperatures from tempX_input. No input was found")]
25    EmptyTempSet,
26}