From b6def3be1a4c25428fe9e74f8de9a6029d425c19 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 --- registry/handlers/layerupload.go | 1 + 1 file changed, 1 insertion(+) diff --git a/registry/handlers/layerupload.go b/registry/handlers/layerupload.go index 8c96b7a6e..5cfa4554c 100644 --- a/registry/handlers/layerupload.go +++ b/registry/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)