use thiserror::Error;
#[derive(Debug, Error)]
pub enum CoreError {
#[error("race when seizing threads")]
RaceTryAgain,
#[error("cannot create a core dump file for the process itself")]
CantDumpItself,
#[error("cannot create a core dump file for custom process info source")]
CustomSourceInfo,
#[error("/proc parsing error")]
ProcParsingError,
#[error("/proc integer parsing error")]
ProcIntParsingError(#[from] std::num::ParseIntError),
#[error("internal error: {0}")]
InternalError(&'static str),
#[error("OS error")]
#[cfg(target_os = "linux")]
NixError(#[from] nix::Error),
#[error("I/O error")]
IoError(#[from] std::io::Error),
}