fix: replace assert! calls in UI activities with graceful error handling

This commit is contained in:
Christian Visintin
2026-04-19 01:54:46 +05:30
parent 49a74d02ea
commit 5758a12c3b
9 changed files with 1622 additions and 1759 deletions
+6 -2
View File
@@ -135,7 +135,9 @@ impl SetupActivity {
error!("Could not leave alternate screen: {}", err);
}
// Lock ports
assert!(self.app.lock_ports().is_ok());
if let Err(err) = self.app.lock_ports() {
error!("Failed to lock ports: {err}");
}
// Write key to file
let res = match edit::edit(placeholder.as_bytes()) {
Ok(rsa_key) => {
@@ -168,7 +170,9 @@ impl SetupActivity {
error!("Could not clear screen screen: {}", err);
}
// Unlock ports
assert!(self.app.unlock_ports().is_ok());
if let Err(err) = self.app.unlock_ports() {
error!("Failed to unlock ports: {err}");
}
}
res