debug: reload: print error message

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
Kohei Tokunaga 2023-10-18 11:25:24 +09:00
parent ac93a7fbfb
commit 38137b29dd
No known key found for this signature in database
GPG Key ID: 6CE0A04690DB3FB3
1 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
controllerapi "github.com/docker/buildx/controller/pb"
"github.com/docker/buildx/monitor/types"
"github.com/docker/buildx/util/progress"
"github.com/moby/buildkit/solver/errdefs"
"github.com/pkg/errors"
)
@ -70,6 +71,11 @@ func (cm *ReloadCmd) Exec(ctx context.Context, args []string) error {
} else {
fmt.Printf("failed to reload: %v\n", err)
}
// report error
for _, s := range errdefs.Sources(err) {
s.Print(cm.stdout)
}
fmt.Fprintf(cm.stdout, "ERROR: %v\n", err)
} else {
resultUpdated = true
}