Skip to content

Commit

Permalink
Merge pull request #8 from rchincha/master
Browse files Browse the repository at this point in the history
routes: fix error codes
  • Loading branch information
rchamarthy authored Jun 27, 2019
2 parents 5296887 + ed2cd51 commit 131e19c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/api/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 131e19c

Please sign in to comment.