mirror of
https://github.com/moby/moby.git
synced 2026-07-11 18:13:57 +00:00
build: log when build is cancelled
I noticed that the daemon logs, even in debug, did not give any indication that the build was cancelled. This patch adds some logs to help debugging. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -245,7 +245,7 @@ func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r *
|
||||
}
|
||||
_, err = output.Write(streamformatter.FormatError(err))
|
||||
if err != nil {
|
||||
log.G(ctx).Warnf("could not write error response: %v", err)
|
||||
log.G(ctx).WithError(err).Warn("could not write error response")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -280,6 +280,9 @@ func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r *
|
||||
ProgressWriter: buildProgressWriter(out, wantAux, createProgressReader),
|
||||
})
|
||||
if err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
log.G(ctx).Debug("build canceled")
|
||||
}
|
||||
return errf(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user