Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pass/Controllers/PasswordNavigationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -528,18 +528,21 @@ 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)
if underlyingError.localizedDescription.contains("WrongPassphrase".localize()) {
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)
}
Expand Down
1 change: 1 addition & 0 deletions pass/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading