aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-09 02:36:17 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:35 +0530
commitdf8ab9613953f5a9fddfc8df8b4c9f95b931c2be (patch)
tree9769f7531c9ee3535f6ab41d7afcea1d50e279d3 /WireGuard/WireGuard/UI/macOS/AppDelegate.swift
parentiOS: Export log: Should present error from the main thread (diff)
downloadwireguard-apple-df8ab9613953f5a9fddfc8df8b4c9f95b931c2be.tar.xz
wireguard-apple-df8ab9613953f5a9fddfc8df8b4c9f95b931c2be.zip
macOS: Handle errors from TunnelsManager.create()
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/AppDelegate.swift')
-rw-r--r--WireGuard/WireGuard/UI/macOS/AppDelegate.swift5
1 files changed, 4 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
index 994495ef..a08f9dc0 100644
--- a/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
+++ b/WireGuard/WireGuard/UI/macOS/AppDelegate.swift
@@ -13,7 +13,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
TunnelsManager.create { [weak self] result in
guard let self = self else { return }
- guard result.isSuccess else { return } // TODO: Show alert
+ if let error = result.error {
+ ErrorPresenter.showErrorAlert(error: error, from: nil)
+ return
+ }
let tunnelsManager: TunnelsManager = result.value!
let statusMenu = StatusMenu(tunnelsManager: tunnelsManager)