From ed2cd512821fd2e897b51f626a6563d7ec3fc74e Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Wed, 26 Jun 2019 17:30:24 -0700 Subject: [PATCH] routes: fix error codes --- pkg/api/routes.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/api/routes.go b/pkg/api/routes.go index 6b13ffacf..c95384847 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -194,6 +194,7 @@ func (rh *RouteHandler) GetManifest(ginCtx *gin.Context) { if err != nil { switch err { case errors.ErrRepoNotFound: + ginCtx.JSON(http.StatusNotFound, NewError(NAME_UNKNOWN, map[string]string{"name": name})) case errors.ErrRepoBadVersion: ginCtx.JSON(http.StatusNotFound, NewError(NAME_UNKNOWN, map[string]string{"name": name})) case errors.ErrManifestNotFound: @@ -518,6 +519,7 @@ func (rh *RouteHandler) GetBlobUpload(ginCtx *gin.Context) { if err != nil { switch err { case errors.ErrBadUploadRange: + ginCtx.JSON(http.StatusBadRequest, NewError(BLOB_UPLOAD_INVALID, map[string]string{"uuid": uuid})) case errors.ErrBadBlobDigest: ginCtx.JSON(http.StatusBadRequest, NewError(BLOB_UPLOAD_INVALID, map[string]string{"uuid": uuid})) case errors.ErrRepoNotFound: