lang, engine: Remove unneeded error wrapping

These situations basically never fail, and if they do, we certainly
don't need more context. This simplifies things a bit.
This commit is contained in:
James Shubin
2023-04-20 18:02:40 -04:00
parent 7075b8b973
commit c5efe7a17b
6 changed files with 52 additions and 54 deletions

View File

@@ -22,7 +22,6 @@ import (
"github.com/purpleidea/mgmt/lang/types"
"github.com/purpleidea/mgmt/pgraph"
"github.com/purpleidea/mgmt/util/errwrap"
)
// ExprAny is a placeholder expression that is used for type unification hacks.
@@ -67,7 +66,7 @@ func (obj *ExprAny) Copy() (Expr, error) {
func (obj *ExprAny) Ordering(produces map[string]Node) (*pgraph.Graph, map[Node]string, error) {
graph, err := pgraph.NewGraph("ordering")
if err != nil {
return nil, nil, errwrap.Wrapf(err, "could not create graph")
return nil, nil, err
}
graph.AddVertex(obj)
@@ -139,7 +138,7 @@ func (obj *ExprAny) Unify() ([]Invariant, error) {
func (obj *ExprAny) Graph() (*pgraph.Graph, error) {
graph, err := pgraph.NewGraph("any")
if err != nil {
return nil, errwrap.Wrapf(err, "could not create graph")
return nil, err
}
graph.AddVertex(obj)
return graph, nil