summaryrefslogtreecommitdiff
path: root/bitmaskd.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-10-10 14:15:55 -0500
committerRuben Pollan <meskio@sindominio.net>2018-10-10 19:27:21 -0500
commitff36a0359c4a1e0053ff43c6f0efbe075894612a (patch)
treee0afc157d95267f2289a658c2a6bb853eb972b95 /bitmaskd.go
parent58f4ee7528d8ba0e5223a9ddf236739287b4ef4c (diff)
[feat] improve readability of errors
Let's not report 'bitmaskd is not running' in standalone mode. - Resolves: #35
Diffstat (limited to 'bitmaskd.go')
-rw-r--r--bitmaskd.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/bitmaskd.go b/bitmaskd.go
index b7036a6..ace9ee7 100644
--- a/bitmaskd.go
+++ b/bitmaskd.go
@@ -17,12 +17,24 @@
package main
import (
+ "errors"
+ "log"
+
"0xacab.org/leap/bitmask-systray/bitmask"
bitmaskd "0xacab.org/leap/bitmask-systray/bitmaskd"
)
+const (
+ notRunning = `Is bitmaskd running? Start bitmask and try again.`
+)
+
func initBitmask() (bitmask.Bitmask, error) {
- return bitmaskd.Init()
+ b, err := bitmaskd.Init()
+ if err != nil {
+ log.Printf("An error ocurred starting bitmaskd: %v", err)
+ err = errors.New(printer.Sprintf(notRunning))
+ }
+ return b, err
}
func newAutostart(appName string, iconPath string) autostart {