mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: Display warning notify when the process module's open method fails to execute
This commit is contained in:
parent
b7d9a0ad6e
commit
cbb47e4511
1 changed files with 8 additions and 1 deletions
|
|
@ -21,7 +21,14 @@ impl Process {
|
||||||
|
|
||||||
match external::shell(opt) {
|
match external::shell(opt) {
|
||||||
Ok(mut child) => {
|
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)?;
|
self.succ(task.id)?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue