Importing: Give a clearer error message on importing an invalid config
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
7a580e8941
commit
b01d09dfb5
|
@ -26,8 +26,8 @@
|
||||||
"alertImportedFromZipTitle (%d)" = "Created %d tunnels";
|
"alertImportedFromZipTitle (%d)" = "Created %d tunnels";
|
||||||
"alertImportedFromZipMessage (%1$d of %2$d)" = "Created %1$d of %2$d tunnels from zip archive";
|
"alertImportedFromZipMessage (%1$d of %2$d)" = "Created %1$d of %2$d tunnels from zip archive";
|
||||||
|
|
||||||
"alertUnableToImportTitle" = "Unable to import tunnel";
|
"alertBadConfigImportTitle" = "Unable to import tunnel";
|
||||||
"alertUnableToImportMessage" = "An error occured when importing the tunnel configuration.";
|
"alertBadConfigImportMessage (%@)" = "The file ‘%@’ does not contain a valid WireGuard configuration";
|
||||||
|
|
||||||
// Tunnel detail and edit UI
|
// Tunnel detail and edit UI
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ class TunnelImporter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
errorPresenterType.showErrorAlert(title: tr("alertUnableToImportTitle"), message: tr("alertUnableToImportMessage"),
|
errorPresenterType.showErrorAlert(title: tr("alertBadConfigImportTitle"), message: tr(format: "alertBadConfigImportMessage (%@)", fileName),
|
||||||
from: sourceVC, onPresented: completionHandler)
|
from: sourceVC, onPresented: completionHandler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue