Error handling: Use WireGuardAppError and WireGuardResult throughout the app
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -3,10 +3,21 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
enum ZipArchiveError: Error {
|
||||
enum ZipArchiveError: WireGuardAppError {
|
||||
case cantOpenInputZipFile
|
||||
case cantOpenOutputZipFileForWriting
|
||||
case badArchive
|
||||
|
||||
func alertText() -> (String, String) {
|
||||
switch (self) {
|
||||
case .cantOpenInputZipFile:
|
||||
return ("Unable to read zip archive", "The zip archive could not be read.")
|
||||
case .cantOpenOutputZipFileForWriting:
|
||||
return ("Unable to create zip archive", "Could not open zip file for writing.")
|
||||
case .badArchive:
|
||||
return ("Unable to read zip archive", "Bad or corrupt zip archive.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ZipArchive {
|
||||
|
||||
Reference in New Issue
Block a user