Global: no periods at the end of error messages

This commit is contained in:
Jason A. Donenfeld 2018-11-03 02:55:19 +01:00
parent 83eeb289c2
commit 6c737545aa
4 changed files with 12 additions and 12 deletions

View File

@ -10,7 +10,7 @@ class ErrorPresenter {
// TunnelManagementError
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:
return ("Unable to create tunnel", "Internal error")
case TunnelManagementError.vpnSystemErrorOnModifyTunnel:
@ -41,7 +41,7 @@ class ErrorPresenter {
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:
os_log("ErrorPresenter: Error not presented: %{public}@", log: OSLog.default, type: .error, "\(error)")

View File

@ -40,7 +40,7 @@ class QRScanViewController: UIViewController {
let captureSession = captureSession,
captureSession.canAddInput(videoInput),
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
}
@ -108,7 +108,7 @@ class QRScanViewController: UIViewController {
func scanDidComplete(withCode code: String) {
let scannedTunnelConfiguration = try? WgQuickConfigFileParser.parse(code, name: "Scanned")
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
}
@ -149,7 +149,7 @@ extension QRScanViewController: AVCaptureMetadataOutputObjectsDelegate {
guard let metadataObject = metadataObjects.first,
let readableObject = metadataObject as? AVMetadataMachineReadableCodeObject,
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
}

View File

@ -364,7 +364,7 @@ class TunnelContainer: NSObject {
resolvedEndpoints: [Endpoint?],
completionHandler: @escaping (Error?) -> Void) {
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)
return
}
@ -384,7 +384,7 @@ class TunnelContainer: NSObject {
guard (tunnelProvider.isEnabled) else {
// In case the tunnel had gotten disabled, re-enable and save it,
// 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.saveToPreferences { [weak self] (error) in
if (error != nil) {
@ -392,7 +392,7 @@ class TunnelContainer: NSObject {
completionHandler(error)
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)
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)
completionHandler(nil)
} 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 {
os_log("Failed to activate tunnel: %{public}@", log: OSLog.default, type: .debug, "\(error)")
status = .inactive
@ -435,7 +435,7 @@ class TunnelContainer: NSObject {
completionHandler(error)
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)
self?.startActivation(recursionCount: recursionCount + 1, lastError: vpnError, tunnelConfiguration: tunnelConfiguration, resolvedEndpoints: resolvedEndpoints, completionHandler: completionHandler)
}

View File

@ -27,9 +27,9 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
os_log("Starting tunnel", log: OSLog.default, type: .info)
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("Please use the WireGuard app to start WireGuard tunnels.") { (_) in
displayMessage("Please use the WireGuard app to start WireGuard tunnels") { (_) in
startTunnelCompletionHandler(PacketTunnelProviderError.invalidOptions)
}
return