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

@@ -23,8 +23,6 @@ import (
"github.com/purpleidea/mgmt/engine"
"github.com/purpleidea/mgmt/pgraph"
"github.com/purpleidea/mgmt/util/errwrap"
multierr "github.com/hashicorp/go-multierror"
)
// AutoEdge adds the automatic edges to the graph.
@@ -49,7 +47,7 @@ func AutoEdge(graph *pgraph.Graph, debug bool, logf func(format string, v ...int
for _, res := range sorted { // for each vertexes autoedges
autoEdgeObj, e := res.AutoEdges()
if e != nil {
err = multierr.Append(err, e) // collect all errors
err = errwrap.Append(err, e) // collect all errors
continue
}
if autoEdgeObj == nil {