Map error type to error code

Signed-off-by: Troels Thomsen <troels@thomsen.io>
This commit is contained in:
Troels Thomsen 2015-12-01 22:26:37 +01:00
parent 1ece510198
commit 300ce35c12
1 changed files with 2 additions and 0 deletions

View File

@ -169,6 +169,8 @@ func (imh *imageManifestHandler) PutImageManifest(w http.ResponseWriter, r *http
switch verificationError := verificationError.(type) {
case distribution.ErrManifestBlobUnknown:
imh.Errors = append(imh.Errors, v2.ErrorCodeManifestBlobUnknown.WithDetail(verificationError.Digest))
case distribution.ErrManifestNameInvalid:
imh.Errors = append(imh.Errors, v2.ErrorCodeNameInvalid.WithDetail(err))
case distribution.ErrManifestUnverified:
imh.Errors = append(imh.Errors, v2.ErrorCodeManifestUnverified)
default: