mirror of
https://github.com/veeso/termscp.git
synced 2026-09-27 06:21:22 -07:00
fix: replace assert! calls in UI activities with graceful error handling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user