diff --git a/src/error.rs b/src/error.rs index 808bca9..9350f4d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -9,12 +9,12 @@ pub enum Error { /// there was a failure when reading or writing the process's memory #[error("failed to access process memory")] AccessMemoryError(String), - /// there was a failure in building the Process or Module struct - #[error("failed to create process")] - CreateProcessError(String), /// there was a failure in creating a snapshot of processes or modules #[error("failed to create snapshot")] CreateSnapshotError(String), + /// there was a failure in building the Process or Module struct + #[error("failed to get process/module")] + ProcessError(String), /// there was a failure in conversion between integers #[error("failed to convert integer")] ConvertIntegerError(#[from] std::num::TryFromIntError), diff --git a/src/process.rs b/src/process.rs index a69b684..e670495 100644 --- a/src/process.rs +++ b/src/process.rs @@ -50,7 +50,7 @@ impl Process { Identifier::Name(ref name) => snapshot.name == *name, }) .ok_or_else(|| { - Error::CreateProcessError(format!( + Error::ProcessError(format!( "failed to find a process with identifier `{identifier}`", )) })?; @@ -70,7 +70,7 @@ impl Process { .into_iter() .find(|snapshot| name.eq_ignore_ascii_case(&snapshot.name)) else { - return Err(Error::CreateProcessError(format!( + return Err(Error::ProcessError(format!( "failed to find a module with identifier `{name}`", ))); };