feat: better taskfile cycle error handling

This commit is contained in:
Pete Davison
2023-09-06 00:00:36 +00:00
parent 0a027df50d
commit 220bf74a9e
3 changed files with 25 additions and 0 deletions

View File

@@ -153,6 +153,12 @@ func (r *Reader) include(node Node) error {
Namespaces: []string{namespace, edge.Properties.Data.(*ast.Include).Namespace},
}
}
if errors.Is(err, graph.ErrEdgeCreatesCycle) {
return errors.TaskfileCycleError{
Source: node.Location(),
Destination: includeNode.Location(),
}
}
return err
})
return nil