macOS: Handle errors from TunnelsManager.create()

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-01-09 02:36:17 +05:30
parent 4a8366421f
commit df8ab96139
1 changed files with 4 additions and 1 deletions

View File

@ -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)