diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-03-11 04:37:51 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-03-11 17:20:50 +0100 |
commit | da761575541809a3a91fad3e469aa3079f435f65 (patch) | |
tree | 06b0183f9d57079f28ffc44420c1b32c056c2b93 /pkg/bitmask | |
parent | c4bfc04603c361e6a3833f5846d311a73073cd18 (diff) |
[bug] fail gracefully on connection initialization errors
There's some corner cases that were very badly captured. On the first
place, it's confusing to quit on connection errors.
Secondly, a side-effect of aborting the initialization of the bitmask
object was a semi-random segfault when trying to access the object.
Here I pass any connection errors to the gui, but leave to the user to
quit the app. This probably will need more work when we want to
terminate the app on unrecoverable errors (no polkit, etc...), but for
now it makes the systray much more usable.
- Resolves: #465
Diffstat (limited to 'pkg/bitmask')
-rw-r--r-- | pkg/bitmask/init.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/bitmask/init.go b/pkg/bitmask/init.go index 02ee544..b6b41b4 100644 --- a/pkg/bitmask/init.go +++ b/pkg/bitmask/init.go @@ -97,8 +97,10 @@ func InitializeBitmask(conf *config.Config) (Bitmask, error) { if !conf.SkipLaunch { err := maybeStartVPN(b, conf) if err != nil { + // we don't want this error to avoid initialization of + // the bitmask object. If we cannot autostart it's not + // so terrible. log.Println("Error starting VPN: ", err) - return nil, err } } return b, nil |