From 83b899dab6c9a7b0df85898d17fb8d7520090149 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Tue, 30 Dec 2014 20:07:37 -0800 Subject: [PATCH] Add blob upload invalid error code --- api/v2/descriptors.go | 8 ++++++++ api/v2/errors.go | 3 +++ doc/SPEC.md | 1 + 3 files changed, 12 insertions(+) diff --git a/api/v2/descriptors.go b/api/v2/descriptors.go index dfbbc6f9..1ee5471e 100644 --- a/api/v2/descriptors.go +++ b/api/v2/descriptors.go @@ -977,6 +977,14 @@ var errorDescriptors = []ErrorDescriptor{ started, this error code may be returned.`, HTTPStatusCodes: []int{http.StatusNotFound}, }, + { + Code: ErrorCodeBlobUploadInvalid, + Value: "BLOB_UPLOAD_INVALID", + Message: "blob upload invalid", + Description: `The blob upload encountered an error and can no + longer proceed.`, + HTTPStatusCodes: []int{http.StatusNotFound}, + }, } var errorCodeToDescriptors map[ErrorCode]ErrorDescriptor diff --git a/api/v2/errors.go b/api/v2/errors.go index 94c646fc..4d5d55c7 100644 --- a/api/v2/errors.go +++ b/api/v2/errors.go @@ -54,6 +54,9 @@ const ( // ErrorCodeBlobUploadUnknown is returned when an upload is unknown. ErrorCodeBlobUploadUnknown + + // ErrorCodeBlobUploadInvalid is returned when an upload is invalid. + ErrorCodeBlobUploadInvalid ) // ParseErrorCode attempts to parse the error code string, returning diff --git a/doc/SPEC.md b/doc/SPEC.md index 13b510e3..ebf4958e 100644 --- a/doc/SPEC.md +++ b/doc/SPEC.md @@ -703,6 +703,7 @@ The error codes encountered via the API are enumerated in the following table: `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned. `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned. + `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed.