diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-07-29 22:31:54 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-04 21:57:57 +0200 |
commit | 5ca6022d007bc83daba1e7297480d37f56554455 (patch) | |
tree | cc592d08276b7f0c8db6a4280bb7fb648b2548fe /aerc.go | |
parent | a8d631177f4315810f0ab7c7d66d38e332ab0916 (diff) | |
download | aerc-5ca6022d007bc83daba1e7297480d37f56554455.tar.gz |
lint: ensure errors are at least logged (errcheck)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'aerc.go')
-rw-r--r-- | aerc.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -164,7 +164,10 @@ func main() { deferLoop := make(chan struct{}) c := crypto.New(conf.General.PgpProvider) - c.Init() + err = c.Init() + if err != nil { + logging.Warnf("failed to initialise crypto interface: %v", err) + } defer c.Close() aerc = widgets.NewAerc(conf, c, func(cmd []string) error { @@ -205,7 +208,10 @@ func main() { err := lib.ConnectAndExec(arg) if err != nil { fmt.Fprintf(os.Stderr, "Failed to communicate to aerc: %v\n", err) - aerc.CloseBackends() + err = aerc.CloseBackends() + if err != nil { + logging.Warnf("failed to close backends: %v", err) + } return } } @@ -223,5 +229,8 @@ func main() { time.Sleep(16 * time.Millisecond) } } - aerc.CloseBackends() + err = aerc.CloseBackends() + if err != nil { + logging.Warnf("failed to close backends: %v", err) + } } |