util: Port all multierr code to new errwrap package

This cleans things up and simplifies a lot of the code. Also it's easier
to just import one error package when needed.
This commit is contained in:
James Shubin
2019-03-12 16:51:37 -04:00
parent 880652f5d4
commit 753d1104ef
21 changed files with 83 additions and 146 deletions

View File

@@ -30,7 +30,6 @@ import (
"github.com/purpleidea/mgmt/util/errwrap"
"github.com/godbus/dbus"
multierr "github.com/hashicorp/go-multierror"
)
// global tweaks of verbosity and code path
@@ -198,9 +197,8 @@ func (obj *Conn) matchSignal(ch chan *dbus.Signal, path dbus.ObjectPath, iface s
removeSignals := func() error {
var errList error
for i := len(argsList) - 1; i >= 0; i-- { // last in first out
if call := bus.Call(engineUtil.DBusRemoveMatch, 0, argsList[i]); call.Err != nil {
errList = multierr.Append(errList, call.Err)
}
call := bus.Call(engineUtil.DBusRemoveMatch, 0, argsList[i])
errList = errwrap.Append(errList, call.Err)
}
return errList
}