improve error reproting on #206

This commit is contained in:
bunnie 2022-09-20 23:24:42 +08:00
parent ba45fc2685
commit 8fe4c50373

View file

@ -938,9 +938,6 @@ impl ActionManager {
match self.pddb.borrow().unlock_basis(&name, Some(BasisRetentionPolicy::Persist)) {
Ok(_) => log::debug!("Basis {} unlocked", name),
Err(e) => match e.kind() {
ErrorKind::AlreadyExists => {
self.modals.show_notification(t!("vault.basis.already_exists", xous::LANG), None).ok();
}
ErrorKind::PermissionDenied => {
self.report_err(t!("vault.error.basis_unlock_error", xous::LANG), None::<std::io::Error>)
},
@ -951,7 +948,16 @@ impl ActionManager {
// do nothing
}
}
Err(e) => self.report_err(t!("vault.error.internal_error", xous::LANG), Some(e)),
Err(e) => {
match e.kind() {
ErrorKind::AlreadyExists => {
self.modals.show_notification(t!("vault.basis.already_exists", xous::LANG), None).ok();
}
_ => {
self.report_err(t!("vault.error.internal_error", xous::LANG), Some(e))
}
}
},
}
} else {
// do nothing