From 8d4b636a60ffd7838e798f940a355c019f747101 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Thu, 23 Apr 2015 13:13:13 -0700 Subject: [PATCH] Return after error in handler This adds a missing return statement. It is not strictly needed since if the io.Copy fails, the Finish operation will fail. Currently, the client reports both errors where this new code will correctly only report the io.Copy error. Signed-off-by: Stephen J Day --- docs/handlers/layerupload.go | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/handlers/layerupload.go b/docs/handlers/layerupload.go index 8c96b7a6e..5cfa4554c 100644 --- a/docs/handlers/layerupload.go +++ b/docs/handlers/layerupload.go @@ -202,6 +202,7 @@ func (luh *layerUploadHandler) PutLayerUploadComplete(w http.ResponseWriter, r * ctxu.GetLogger(luh).Errorf("unknown error copying into upload: %v", err) w.WriteHeader(http.StatusInternalServerError) luh.Errors.Push(v2.ErrorCodeUnknown, err) + return } layer, err := luh.Upload.Finish(dgst)