0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

Merge pull request #8 from rchincha/master

routes: fix error codes
This commit is contained in:
Ravi Chamarthy 2019-06-26 17:43:15 -07:00 committed by GitHub
commit 131e19c26d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: