diff --git a/pass/Controllers/PasswordNavigationViewController.swift b/pass/Controllers/PasswordNavigationViewController.swift index c635f80..addc46c 100644 --- a/pass/Controllers/PasswordNavigationViewController.swift +++ b/pass/Controllers/PasswordNavigationViewController.swift @@ -528,11 +528,10 @@ extension PasswordNavigationViewController: PasswordAlertPresenter { SVProgressHUD.showSuccess(withStatus: "Done".localize()) SVProgressHUD.dismiss(withDelay: 1) } - } catch { + } catch let error as NSError { gitCredential.delete() DispatchQueue.main.async { SVProgressHUD.dismiss() - let error = error as NSError var message = error.localizedDescription if let underlyingError = error.userInfo[NSUnderlyingErrorKey] as? NSError { message = message | "UnderlyingError".localize(underlyingError.localizedDescription) @@ -540,6 +539,10 @@ extension PasswordNavigationViewController: PasswordAlertPresenter { message = message | "RecoverySuggestion.".localize() } } + if let mergeConflictFiles = error.userInfo[GTPullMergeConflictedFiles] as? NSArray { + let mergeConflictFilesString = mergeConflictFiles.componentsJoined(by: ", ") + message = message | "MergeConflictError".localize(mergeConflictFilesString) + } DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(800)) { Utils.alert(title: "Error".localize(), message: message, controller: self, completion: nil) } diff --git a/pass/en.lproj/Localizable.strings b/pass/en.lproj/Localizable.strings index 10551af..5f26010 100644 --- a/pass/en.lproj/Localizable.strings +++ b/pass/en.lproj/Localizable.strings @@ -34,6 +34,7 @@ "UnresolvedError" = "Unresolved error %@"; "MigrationError" = "Migration error: %@"; "UnderlyingError" = "Underlying Error: %@"; +"MergeConflictError" = "Conflict files: %@"; "ErrorSaving" = "Error saving: %@"; "CannotCopyPassword" = "Cannot copy password"; "CannotAddPassword" = "Cannot add password";