client: fix cue error reporting

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-03-31 14:20:02 -07:00
parent 993b96dcb4
commit b9bd250634

View File

@ -93,7 +93,7 @@ func (c *Client) Up(ctx context.Context, deployment *Deployment) (*compiler.Valu
return err
})
return out, compiler.Err(eg.Wait())
return out, eg.Wait()
}
func (c *Client) buildfn(ctx context.Context, deployment *Deployment, ch chan *bk.SolveStatus, w io.WriteCloser) error {
@ -140,7 +140,7 @@ func (c *Client) buildfn(ctx context.Context, deployment *Deployment, ch chan *b
// Compute output overlay
lg.Debug().Msg("computing deployment")
if err := deployment.Up(ctx, s, nil); err != nil {
return nil, err
return nil, compiler.Err(err)
}
// Export deployment to a cue directory
@ -208,7 +208,7 @@ func (c *Client) outputfn(ctx context.Context, r io.Reader) (*compiler.Value, er
return nil, err
}
if err := out.FillPath(cue.MakePath(), v); err != nil {
return nil, fmt.Errorf("%s: %w", h.Name, err)
return nil, fmt.Errorf("%s: %w", h.Name, compiler.Err(err))
}
}
return out, nil