pipeline: better error handling on WriteFile

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-04-22 09:43:45 -07:00
parent 3e2b46bf3a
commit 6e16207221

View File

@ -831,8 +831,10 @@ func (p *Pipeline) WriteFile(ctx context.Context, op *compiler.Value, st llb.Sta
if err == nil {
content = []byte(str)
}
case cue.BottomKind:
err = fmt.Errorf("%s: WriteFile content is not set", op.Path().String())
default:
err = fmt.Errorf("unhandled data type in WriteFile: %s", kind)
err = fmt.Errorf("%s: unhandled data type in WriteFile: %s", op.Path().String(), kind)
}
if err != nil {
return st, err