mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2025-07-02 01:04:16 +00:00
fixed pm3 exit code
This commit is contained in:
parent
3c1290aec3
commit
6b9ef20187
@ -62,10 +62,15 @@ pub async fn run_pm3(tx: broadcast::Sender<String>) -> Result<()> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let status = cmd.wait().await?;
|
let status = cmd.wait().await?;
|
||||||
if status.success() {
|
|
||||||
|
// We use the exit code here because status.success() is false if the child was terminated by a
|
||||||
|
// signal
|
||||||
|
let code = status.code().unwrap_or(0);
|
||||||
|
|
||||||
|
if code == 0 {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow!("PM3 exited with a non-zero exit code"))
|
Err(anyhow!("PM3 exited with a non-zero exit code: {code}"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user