feat: Display warning notify when the process module's open method fails to execute

This commit is contained in:
Prajna 2024-03-04 23:50:51 +08:00
parent b7d9a0ad6e
commit cbb47e4511

View file

@ -21,7 +21,14 @@ impl Process {
match external::shell(opt) {
Ok(mut child) => {
child.wait().await.ok();
let status = child.wait().await?;
if !status.success() {
let message = match status.code() {
Some(code) => format!("Exited with status code: {code}"),
None => "Process terminated by signal".to_string(),
};
AppProxy::warn("Process failed", message.as_str());
}
self.succ(task.id)?;
}
Err(e) => {