Skip to content

Commit

Permalink
feat: ✨ Also print errors from the std lib
Browse files Browse the repository at this point in the history
  • Loading branch information
AntwortEinesLebens committed Feb 1, 2025
1 parent 33211fb commit 5432812
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/commands/traces/drivers/byovd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ impl Runnable for Byovd {
displayer.success("The application has administrator privileges");
displayer.loading("Checking the driver path validity");

let Ok(driver_exists) = self.driver.try_exists() else {
displayer.failure("Failed to check the existence of the driver path");
let driver_exists = match self.driver.try_exists() {
Ok(driver_exists) => driver_exists,
Err(error) => {
displayer.failure(
format!("Failed to check the existence of the driver path: {error}").as_str(),
);

return ExitCode::FAILURE;
return ExitCode::FAILURE;
}
};

if !driver_exists || !self.driver.is_file() {
Expand Down
12 changes: 9 additions & 3 deletions src/commands/traces/processes/spoofing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ impl Runnable for Spoofing {
let mut displayer = Displayer::new();
displayer.loading("Checking the executable path validity");

let Ok(executable_exists) = self.executable.try_exists() else {
displayer.failure("Failed to check the existence of the executable path");
let executable_exists = match self.executable.try_exists() {
Ok(executable_exists) => executable_exists,
Err(error) => {
displayer.failure(
format!("Failed to check the existence of the executable path: {error}")
.as_str(),
);

return ExitCode::FAILURE;
return ExitCode::FAILURE;
}
};

if !executable_exists || !self.executable.is_file() {
Expand Down

0 comments on commit 5432812

Please sign in to comment.