From 2962ccc24b39967b2a623fb889f3289939ca46fa Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 30 Oct 2019 12:04:39 -0500 Subject: [PATCH] Added error handling for OPML import. --- iOS/Settings/SettingsViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index cff7c1d82..ce66d6a56 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -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) + } + } } }