Skip to content

Commit

Permalink
chore: use native error messages from command output (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
Integral-Tech authored Jan 11, 2025
1 parent f48a271 commit b68e417
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/kernel/lkm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ impl KernelModules<'_> {
self.current_info.stylize_data(
Box::leak(
util::exec_cmd("modinfo", &[&self.current_name])
.unwrap_or_else(|_| {
String::from("module information not available")
.unwrap_or_else(|e| {
format!("module information not available: {e}")
})
.replace("signature: ", "signature: \n")
.into_boxed_str(),
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl KernelLogs {
"dmesg",
&["--kernel", "--human", "--ctime", "--color=never"],
)
.unwrap_or_else(|_| String::from("failed to retrieve dmesg output"));
.unwrap_or_else(|e| format!("failed to retrieve dmesg output: {e}"));
let logs_updated =
self.output.lines().next_back().unwrap_or_default() != self.last_line;
self.last_line = self
Expand Down

0 comments on commit b68e417

Please sign in to comment.