Skip to content

Commit 7ccaff0

Browse files
committed
Better error handling for Keystore generation
1 parent b356319 commit 7ccaff0

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/renutil.rs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -875,11 +875,25 @@ pub async fn install(
875875
"-validity",
876876
"20000",
877877
]);
878-
println!("Command: {cmd:?}");
879-
let status = cmd.status()?;
880-
if !status.success() {
881-
anyhow::bail!("Unable to generate Android keystore.");
882-
}
878+
match cmd.status() {
879+
Ok(status) => {
880+
if !status.success() {
881+
match status.code() {
882+
Some(code) => {
883+
anyhow::bail!(
884+
"Unable to generate Android keystore: Exit code {code}\nCommand: {cmd:?}"
885+
)
886+
}
887+
None => anyhow::bail!(
888+
"Unable to generate Android keystore: Terminated by signal\nCommand: {cmd:?}"
889+
),
890+
}
891+
};
892+
}
893+
Err(e) => {
894+
anyhow::bail!("Unable to generate Android keystore: {e}\nCommand: {cmd:?}");
895+
}
896+
};
883897
}
884898

885899
let bundle_keystore = Path::new("bundle.keystore");

0 commit comments

Comments
 (0)