Global: no periods at the end of error messages
This commit is contained in:
parent
83eeb289c2
commit
6c737545aa
|
@ -10,7 +10,7 @@ class ErrorPresenter {
|
||||||
|
|
||||||
// TunnelManagementError
|
// TunnelManagementError
|
||||||
case TunnelManagementError.tunnelAlreadyExistsWithThatName:
|
case TunnelManagementError.tunnelAlreadyExistsWithThatName:
|
||||||
return ("Name already exists", "A tunnel with that name already exists. Please choose a different name.")
|
return ("Name already exists", "A tunnel with that name already exists")
|
||||||
case TunnelManagementError.vpnSystemErrorOnAddTunnel:
|
case TunnelManagementError.vpnSystemErrorOnAddTunnel:
|
||||||
return ("Unable to create tunnel", "Internal error")
|
return ("Unable to create tunnel", "Internal error")
|
||||||
case TunnelManagementError.vpnSystemErrorOnModifyTunnel:
|
case TunnelManagementError.vpnSystemErrorOnModifyTunnel:
|
||||||
|
@ -41,7 +41,7 @@ class ErrorPresenter {
|
||||||
fatalError()
|
fatalError()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return ("Activation failure", "Another tunnel is currently \(statusString). Only one tunnel may be in operation at a time.")
|
return ("Activation failure", "Another tunnel is currently \(statusString)")
|
||||||
|
|
||||||
default:
|
default:
|
||||||
os_log("ErrorPresenter: Error not presented: %{public}@", log: OSLog.default, type: .error, "\(error)")
|
os_log("ErrorPresenter: Error not presented: %{public}@", log: OSLog.default, type: .error, "\(error)")
|
||||||
|
|
|
@ -40,7 +40,7 @@ class QRScanViewController: UIViewController {
|
||||||
let captureSession = captureSession,
|
let captureSession = captureSession,
|
||||||
captureSession.canAddInput(videoInput),
|
captureSession.canAddInput(videoInput),
|
||||||
captureSession.canAddOutput(metadataOutput) else {
|
captureSession.canAddOutput(metadataOutput) else {
|
||||||
scanDidEncounterError(title: "Camera Unsupported", message: "This device is not able to scan QR codes.")
|
scanDidEncounterError(title: "Camera Unsupported", message: "This device is not able to scan QR codes")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ class QRScanViewController: UIViewController {
|
||||||
func scanDidComplete(withCode code: String) {
|
func scanDidComplete(withCode code: String) {
|
||||||
let scannedTunnelConfiguration = try? WgQuickConfigFileParser.parse(code, name: "Scanned")
|
let scannedTunnelConfiguration = try? WgQuickConfigFileParser.parse(code, name: "Scanned")
|
||||||
guard let tunnelConfiguration = scannedTunnelConfiguration else {
|
guard let tunnelConfiguration = scannedTunnelConfiguration else {
|
||||||
scanDidEncounterError(title: "Invalid QR Code", message: "The scanned QR code is not a valid WireGuard configuration.")
|
scanDidEncounterError(title: "Invalid QR Code", message: "The scanned QR code is not a valid WireGuard configuration")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ extension QRScanViewController: AVCaptureMetadataOutputObjectsDelegate {
|
||||||
guard let metadataObject = metadataObjects.first,
|
guard let metadataObject = metadataObjects.first,
|
||||||
let readableObject = metadataObject as? AVMetadataMachineReadableCodeObject,
|
let readableObject = metadataObject as? AVMetadataMachineReadableCodeObject,
|
||||||
let stringValue = readableObject.stringValue else {
|
let stringValue = readableObject.stringValue else {
|
||||||
scanDidEncounterError(title: "Invalid Code", message: "The scanned code could not be read.")
|
scanDidEncounterError(title: "Invalid Code", message: "The scanned code could not be read")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,7 @@ class TunnelContainer: NSObject {
|
||||||
resolvedEndpoints: [Endpoint?],
|
resolvedEndpoints: [Endpoint?],
|
||||||
completionHandler: @escaping (Error?) -> Void) {
|
completionHandler: @escaping (Error?) -> Void) {
|
||||||
if (recursionCount >= 8) {
|
if (recursionCount >= 8) {
|
||||||
os_log("startActivation: Failed after 8 attempts. Giving up with %{public}@.", log: OSLog.default, type: .error, "\(lastError!)")
|
os_log("startActivation: Failed after 8 attempts. Giving up with %{public}@", log: OSLog.default, type: .error, "\(lastError!)")
|
||||||
completionHandler(TunnelActivationError.tunnelActivationFailed)
|
completionHandler(TunnelActivationError.tunnelActivationFailed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -384,7 +384,7 @@ class TunnelContainer: NSObject {
|
||||||
guard (tunnelProvider.isEnabled) else {
|
guard (tunnelProvider.isEnabled) else {
|
||||||
// In case the tunnel had gotten disabled, re-enable and save it,
|
// In case the tunnel had gotten disabled, re-enable and save it,
|
||||||
// then call this function again.
|
// then call this function again.
|
||||||
os_log("startActivation: Tunnel is disabled. Re-enabling and saving.", log: OSLog.default, type: .info)
|
os_log("startActivation: Tunnel is disabled. Re-enabling and saving", log: OSLog.default, type: .info)
|
||||||
tunnelProvider.isEnabled = true
|
tunnelProvider.isEnabled = true
|
||||||
tunnelProvider.saveToPreferences { [weak self] (error) in
|
tunnelProvider.saveToPreferences { [weak self] (error) in
|
||||||
if (error != nil) {
|
if (error != nil) {
|
||||||
|
@ -392,7 +392,7 @@ class TunnelContainer: NSObject {
|
||||||
completionHandler(error)
|
completionHandler(error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
os_log("startActivation: Tunnel saved after re-enabling.", log: OSLog.default, type: .info)
|
os_log("startActivation: Tunnel saved after re-enabling", log: OSLog.default, type: .info)
|
||||||
os_log("startActivation: Invoking startActivation", log: OSLog.default, type: .debug)
|
os_log("startActivation: Invoking startActivation", log: OSLog.default, type: .debug)
|
||||||
self?.startActivation(recursionCount: recursionCount + 1, lastError: NEVPNError(NEVPNError.configurationUnknown), tunnelConfiguration: tunnelConfiguration, resolvedEndpoints: resolvedEndpoints, completionHandler: completionHandler)
|
self?.startActivation(recursionCount: recursionCount + 1, lastError: NEVPNError(NEVPNError.configurationUnknown), tunnelConfiguration: tunnelConfiguration, resolvedEndpoints: resolvedEndpoints, completionHandler: completionHandler)
|
||||||
}
|
}
|
||||||
|
@ -411,7 +411,7 @@ class TunnelContainer: NSObject {
|
||||||
os_log("startActivation: Success", log: OSLog.default, type: .debug)
|
os_log("startActivation: Success", log: OSLog.default, type: .debug)
|
||||||
completionHandler(nil)
|
completionHandler(nil)
|
||||||
} catch (let error) {
|
} catch (let error) {
|
||||||
os_log("startActivation: Error starting tunnel. Examining error.", log: OSLog.default, type: .debug)
|
os_log("startActivation: Error starting tunnel. Examining error", log: OSLog.default, type: .debug)
|
||||||
guard let vpnError = error as? NEVPNError else {
|
guard let vpnError = error as? NEVPNError else {
|
||||||
os_log("Failed to activate tunnel: %{public}@", log: OSLog.default, type: .debug, "\(error)")
|
os_log("Failed to activate tunnel: %{public}@", log: OSLog.default, type: .debug, "\(error)")
|
||||||
status = .inactive
|
status = .inactive
|
||||||
|
@ -435,7 +435,7 @@ class TunnelContainer: NSObject {
|
||||||
completionHandler(error)
|
completionHandler(error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
os_log("startActivation: Tunnel reloaded.", log: OSLog.default, type: .info)
|
os_log("startActivation: Tunnel reloaded", log: OSLog.default, type: .info)
|
||||||
os_log("startActivation: Invoking startActivation", log: OSLog.default, type: .debug)
|
os_log("startActivation: Invoking startActivation", log: OSLog.default, type: .debug)
|
||||||
self?.startActivation(recursionCount: recursionCount + 1, lastError: vpnError, tunnelConfiguration: tunnelConfiguration, resolvedEndpoints: resolvedEndpoints, completionHandler: completionHandler)
|
self?.startActivation(recursionCount: recursionCount + 1, lastError: vpnError, tunnelConfiguration: tunnelConfiguration, resolvedEndpoints: resolvedEndpoints, completionHandler: completionHandler)
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,9 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||||
os_log("Starting tunnel", log: OSLog.default, type: .info)
|
os_log("Starting tunnel", log: OSLog.default, type: .info)
|
||||||
|
|
||||||
guard let options = options else {
|
guard let options = options else {
|
||||||
os_log("Starting tunnel failed: No options passed. Possible connection request from preferences.", log: OSLog.default, type: .error)
|
os_log("Starting tunnel failed: No options passed. Possible connection request from preferences", log: OSLog.default, type: .error)
|
||||||
// displayMessage is deprecated API
|
// displayMessage is deprecated API
|
||||||
displayMessage("Please use the WireGuard app to start WireGuard tunnels.") { (_) in
|
displayMessage("Please use the WireGuard app to start WireGuard tunnels") { (_) in
|
||||||
startTunnelCompletionHandler(PacketTunnelProviderError.invalidOptions)
|
startTunnelCompletionHandler(PacketTunnelProviderError.invalidOptions)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue