Cleanup code of error handling
This commit is contained in:
parent
9a3131943f
commit
2bfb36c527
8 changed files with 17 additions and 43 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -410,7 +410,6 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
|
|||
SVProgressHUD.dismiss(withDelay: 0.6)
|
||||
}
|
||||
} catch {
|
||||
print(error)
|
||||
DispatchQueue.main.async {
|
||||
// remove the wrong passphrase so that users could enter it next time
|
||||
self.passwordStore.pgpKeyPassphrase = nil
|
||||
|
|
|
|||
|
|
@ -80,9 +80,7 @@ class QRScannerController: UIViewController, AVCaptureMetadataOutputObjectsDeleg
|
|||
}
|
||||
|
||||
} catch {
|
||||
print(error)
|
||||
scannerOutput.text = error.localizedDescription
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
|
|||
SVProgressHUD.setDefaultMaskType(.black)
|
||||
SVProgressHUD.setDefaultStyle(.light)
|
||||
SVProgressHUD.show(withStatus: "Fetching PGP Key")
|
||||
passwordStore.pgpKeyImportFromFileSharing()
|
||||
DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
|
||||
do {
|
||||
try self.passwordStore.pgpKeyImportFromFileSharing()
|
||||
try self.passwordStore.initPGPKeys()
|
||||
DispatchQueue.main.async {
|
||||
self.pgpKeyTableViewCell.detailTextLabel?.text = self.passwordStore.pgpKeyID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue