From f6d75a61398aad77c81eb2fd2cfaf68c5f69116a 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 8c96b7a6..5cfa4554 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)