Skip to content

Commit ed2cd51

Browse files
author
Ramkumar Chinchani
committed
routes: fix error codes
1 parent c142daf commit ed2cd51

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/api/routes.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ func (rh *RouteHandler) GetManifest(ginCtx *gin.Context) {
194194
if err != nil {
195195
switch err {
196196
case errors.ErrRepoNotFound:
197+
ginCtx.JSON(http.StatusNotFound, NewError(NAME_UNKNOWN, map[string]string{"name": name}))
197198
case errors.ErrRepoBadVersion:
198199
ginCtx.JSON(http.StatusNotFound, NewError(NAME_UNKNOWN, map[string]string{"name": name}))
199200
case errors.ErrManifestNotFound:
@@ -518,6 +519,7 @@ func (rh *RouteHandler) GetBlobUpload(ginCtx *gin.Context) {
518519
if err != nil {
519520
switch err {
520521
case errors.ErrBadUploadRange:
522+
ginCtx.JSON(http.StatusBadRequest, NewError(BLOB_UPLOAD_INVALID, map[string]string{"uuid": uuid}))
521523
case errors.ErrBadBlobDigest:
522524
ginCtx.JSON(http.StatusBadRequest, NewError(BLOB_UPLOAD_INVALID, map[string]string{"uuid": uuid}))
523525
case errors.ErrRepoNotFound:

0 commit comments

Comments
 (0)