Error handling: alertText() can be nil

Indicating that no alert is to be shown for that error.

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander committed 2018-12-11 00:34:22 +05:30
1 parent 851bd8102d
commit 15b6cf5412
6 files changed
+6 -6

No files matched your search

@@ -8,7 +8,7 @@ enum ZipArchiveError: WireGuardAppError {
case cantOpenOutputZipFileForWriting
case badArchive
func alertText() -> (String, String) {
func alertText() -> (String, String)? {
switch (self) {
case .cantOpenInputZipFile:
return ("Unable to read zip archive", "The zip archive could not be read.")
@@ -6,7 +6,7 @@ import UIKit
enum ZipExporterError: WireGuardAppError {
case noTunnelsToExport
func alertText() -> (String, String) {
func alertText() -> (String, String)? {
switch (self) {
case .noTunnelsToExport:
return ("Nothing to export", "There are no tunnels to export")
@@ -6,7 +6,7 @@ import UIKit
enum ZipImporterError: WireGuardAppError {
case noTunnelsInZipArchive
func alertText() -> (String, String) {
func alertText() -> (String, String)? {
switch (self) {
case .noTunnelsInZipArchive:
return ("No tunnels in zip archive", "No .conf tunnel files were found inside the zip archive.")