From cbb47e451190c951609a3d695171fec37d205b31 Mon Sep 17 00:00:00 2001 From: Prajna Date: Mon, 4 Mar 2024 23:50:51 +0800 Subject: [PATCH] feat: Display warning notify when the process module's open method fails to execute --- yazi-scheduler/src/process/process.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yazi-scheduler/src/process/process.rs b/yazi-scheduler/src/process/process.rs index 12582964..db3d531d 100644 --- a/yazi-scheduler/src/process/process.rs +++ b/yazi-scheduler/src/process/process.rs @@ -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) => {