Adding additional error verification

Signed-off-by: dubo-dubon-duponey <dubodubonduponey+github@pm.me>
This commit is contained in:
dubo-dubon-duponey 2021-05-12 16:11:19 -07:00
parent e9968e4c90
commit 91c4f9c8e6
No known key found for this signature in database
GPG Key ID: C3B96779C681DA56

View File

@ -66,6 +66,11 @@ func Build(sources map[string]fs.FS, args ...string) (*Value, error) {
if err != nil {
return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{}))
}
for _, value := range v {
if value.Err() != nil {
return nil, value.Err()
}
}
if len(v) != 1 {
return nil, errors.New("internal: wrong number of values")
}