Importing: Give a clearer error message on importing an invalid config

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-02-22 13:03:03 +05:30
parent 7a580e8941
commit b01d09dfb5
2 changed files with 3 additions and 3 deletions

View File

@ -26,8 +26,8 @@
"alertImportedFromZipTitle (%d)" = "Created %d tunnels";
"alertImportedFromZipMessage (%1$d of %2$d)" = "Created %1$d of %2$d tunnels from zip archive";
"alertUnableToImportTitle" = "Unable to import tunnel";
"alertUnableToImportMessage" = "An error occured when importing the tunnel configuration.";
"alertBadConfigImportTitle" = "Unable to import tunnel";
"alertBadConfigImportMessage (%@)" = "The file %@ does not contain a valid WireGuard configuration";
// Tunnel detail and edit UI

View File

@ -41,7 +41,7 @@ class TunnelImporter {
}
}
} else {
errorPresenterType.showErrorAlert(title: tr("alertUnableToImportTitle"), message: tr("alertUnableToImportMessage"),
errorPresenterType.showErrorAlert(title: tr("alertBadConfigImportTitle"), message: tr(format: "alertBadConfigImportMessage (%@)", fileName),
from: sourceVC, onPresented: completionHandler)
}
}