diff options
Diffstat (limited to 'src/utils/error.rs')
-rw-r--r-- | src/utils/error.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/utils/error.rs b/src/utils/error.rs index 3764469c..9e556f57 100644 --- a/src/utils/error.rs +++ b/src/utils/error.rs @@ -2,9 +2,6 @@ use std::{borrow::Cow, result}; use thiserror::Error; -#[cfg(target_os = "linux")] -use procfs::ProcError; - /// A type alias for handling errors related to Bottom. pub type Result<T> = result::Result<T, BottomError>; @@ -35,10 +32,6 @@ pub enum BottomError { /// An error that just signifies something minor went wrong; no message. #[error("Minor error.")] MinorError, - /// An error to represent errors with procfs - #[cfg(target_os = "linux")] - #[error("Procfs error, {0}")] - ProcfsError(String), } impl From<std::io::Error> for BottomError { @@ -93,23 +86,3 @@ impl From<regex::Error> for BottomError { BottomError::QueryError(format!("Regex error: {}", error.last().unwrap_or(&"")).into()) } } - -#[cfg(target_os = "linux")] -impl From<ProcError> for BottomError { - fn from(err: ProcError) -> Self { - match err { - ProcError::PermissionDenied(p) => { - BottomError::ProcfsError(format!("Permission denied for {:?}", p)) - } - ProcError::NotFound(p) => BottomError::ProcfsError(format!("{:?} not found", p)), - ProcError::Incomplete(p) => BottomError::ProcfsError(format!("{:?} incomplete", p)), - ProcError::Io(e, p) => { - BottomError::ProcfsError(format!("io error: {:?} for {:?}", e, p)) - } - ProcError::Other(s) => BottomError::ProcfsError(format!("Other procfs error: {}", s)), - ProcError::InternalError(e) => { - BottomError::ProcfsError(format!("procfs internal error: {:?}", e)) - } - } - } -} |