Cleanup code of error handling

This commit is contained in:
Bob Sun 2018-11-17 21:41:28 -08:00
parent 9a3131943f
commit 2bfb36c527
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
8 changed files with 17 additions and 43 deletions

View file

@ -230,10 +230,14 @@ class GitServerSettingTableViewController: UITableViewController {
// might keys updated via iTunes, or downloaded/pasted inside the app
fileActionTitle.append(" (Import)")
let fileAction = UIAlertAction(title: fileActionTitle, style: .default) { _ in
self.passwordStore.gitSSHKeyImportFromFileSharing()
SharedDefaults[.gitSSHKeySource] = "file"
SVProgressHUD.showSuccess(withStatus: "Imported")
SVProgressHUD.dismiss(withDelay: 1)
do {
try self.passwordStore.gitSSHKeyImportFromFileSharing()
SharedDefaults[.gitSSHKeySource] = "file"
SVProgressHUD.showSuccess(withStatus: "Imported")
SVProgressHUD.dismiss(withDelay: 1)
} catch {
Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil)
}
}
optionMenu.addAction(fileAction)
} else {