summaryrefslogtreecommitdiff
path: root/standalone.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 /standalone.go
parent58f4ee7528d8ba0e5223a9ddf236739287b4ef4c (diff)
[feat] improve readability of errors
Let's not report 'bitmaskd is not running' in standalone mode. - Resolves: #35
Diffstat (limited to 'standalone.go')
-rw-r--r--standalone.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/standalone.go b/standalone.go
index e2c9f66..ebcc040 100644
--- a/standalone.go
+++ b/standalone.go
@@ -17,6 +17,8 @@
package main
import (
+ "errors"
+ "log"
"os"
"0xacab.org/leap/bitmask-systray/bitmask"
@@ -24,8 +26,17 @@ import (
pmautostart "github.com/ProtonMail/go-autostart"
)
+const (
+ errorMsg = `An error has ocurred initializing %s: %v`
+)
+
func initBitmask() (bitmask.Bitmask, error) {
- return standalone.Init()
+ b, err := standalone.Init()
+ if err != nil {
+ log.Printf("An error ocurred starting standalone bitmask: %v", err)
+ err = errors.New(printer.Sprintf(errorMsg, applicationName, err))
+ }
+ return b, err
}
func newAutostart(appName string, iconPath string) autostart {