diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-06-04 20:39:35 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-06-04 20:39:35 +0200 |
commit | 8c3ba3a2d6a3db9d277c9d6b7532d125b39e1676 (patch) | |
tree | b0ee3f0075f6d83346eef01c7f65d0542088165a /main.go | |
parent | 67e258a7a2217300a43c8aa0636bfe4d4aef6bdb (diff) |
[feat] notify if it can't start the VPN0.0.1
- Resolves: #35
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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() { |