Ensure we log io.Copy errors and bytes copied/total in uploads
Signed-off-by: Tony Holdstock-Brown <tony@docker.com>
This commit is contained in:
parent
20fa47886d
commit
25c5efdef9
1 changed files with 5 additions and 1 deletions
|
@ -46,7 +46,11 @@ func copyFullPayload(responseWriter http.ResponseWriter, r *http.Request, destWr
|
||||||
// instead of showing 0 for the HTTP status.
|
// instead of showing 0 for the HTTP status.
|
||||||
responseWriter.WriteHeader(499)
|
responseWriter.WriteHeader(499)
|
||||||
|
|
||||||
ctxu.GetLogger(context).Error("client disconnected during " + action)
|
ctxu.GetLoggerWithFields(context, map[interface{}]interface{}{
|
||||||
|
"error": err,
|
||||||
|
"copied": copied,
|
||||||
|
"contentLength": r.ContentLength,
|
||||||
|
}, "error", "copied", "contentLength").Error("client disconnected during " + action)
|
||||||
return errors.New("client disconnected")
|
return errors.New("client disconnected")
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue