Added error handling for OPML import.

This commit is contained in:
Maurice Parker 2019-10-30 12:04:39 -05:00
parent 64446ec609
commit 2962ccc24b
1 changed files with 9 additions and 1 deletions

View File

@ -264,7 +264,15 @@ extension SettingsViewController: UIDocumentPickerDelegate {
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
for url in urls {
opmlAccount?.importOPML(url) { result in}
opmlAccount?.importOPML(url) { result in
switch result {
case .success:
break
case .failure(let error):
let title = NSLocalizedString("Import Failed", comment: "Import Failed")
self.presentError(title: title, message: error.localizedDescription)
}
}
}
}