aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-10 02:37:34 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-10 03:37:23 +0100
commita9aa443ea78cf9926524dda8680a1e1a38d425c9 (patch)
treeac98e26149c9829900e84977569452a2a9274a56 /ui
parentinstaller: bring to foreground using shellexec process (diff)
downloadwireguard-windows-a9aa443ea78cf9926524dda8680a1e1a38d425c9.tar.xz
wireguard-windows-a9aa443ea78cf9926524dda8680a1e1a38d425c9.zip
service: keep track of proper errors
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 18c83e2d..db97823d 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -242,8 +242,15 @@ func RunUI() {
}
}
}
- service.IPCClientRegisterTunnelChange(func(tunnel *service.Tunnel, state service.TunnelState) {
- setServiceState(tunnel, state, true)
+ service.IPCClientRegisterTunnelChange(func(tunnel *service.Tunnel, state service.TunnelState, err error) {
+ setServiceState(tunnel, state, err == nil)
+ if err != nil {
+ if mw.Visible() {
+ walk.MsgBox(mw, "Tunnel Error", err.Error()+"\n\nPlease consult the Windows Event Log for more information.", walk.MsgBoxIconWarning)
+ } else {
+ tray.ShowError("WireGuard Tunnel Error", err.Error())
+ }
+ }
})
go func() {
tunnels, err := service.IPCClientTunnels()