summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-06-04 20:39:35 +0200
committerRuben Pollan <meskio@sindominio.net>2018-06-04 20:39:35 +0200
commit8c3ba3a2d6a3db9d277c9d6b7532d125b39e1676 (patch)
treeb0ee3f0075f6d83346eef01c7f65d0542088165a /main.go
parent67e258a7a2217300a43c8aa0636bfe4d4aef6bdb (diff)
[feat] notify if it can't start the VPN0.0.1
- Resolves: #35
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/main.go b/main.go
index 503d4ff..ddea432 100644
--- a/main.go
+++ b/main.go
@@ -75,7 +75,11 @@ func checkAndStartBitmask(b *bitmask.Bitmask, notify *notificator, conf *systray
log.Printf("Is bitmask running? %v", err)
os.Exit(1)
}
- maybeStartVPN(b, conf)
+ err = maybeStartVPN(b, conf)
+ if err != nil {
+ log.Println("Error starting VPN: ", err)
+ notify.errorStartingVPN(err)
+ }
}
func checkAndInstallHelpers(b *bitmask.Bitmask, notify *notificator) error {
@@ -97,16 +101,14 @@ func checkAndInstallHelpers(b *bitmask.Bitmask, notify *notificator) error {
return nil
}
-func maybeStartVPN(b *bitmask.Bitmask, conf *systrayConfig) {
+func maybeStartVPN(b *bitmask.Bitmask, conf *systrayConfig) error {
if conf.UserStoppedVPN {
- return
+ return nil
}
err := b.StartVPN(provider)
- if err != nil {
- log.Println("Error starting VPN: ", err)
- }
conf.setUserStoppedVPN(false)
+ return err
}
func initPrinter() {