Cloud API: add error for failed customization validation

Add new error `ErrorInvalidCustomization` used in situations when the
user-provided customization values don't pass validation. This will be
used by the Directory  / File customization.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2023-02-06 11:59:45 +01:00 committed by Sanne Raymaekers
parent ffd0bdb7ad
commit 15f1962c34

View file

@ -45,6 +45,7 @@ const (
ErrorUnsupportedImage ServiceErrorCode = 32
ErrorInvalidImageFromComposeId ServiceErrorCode = 33
ErrorImageNotFound ServiceErrorCode = 34
ErrorInvalidCustomization ServiceErrorCode = 35
// Internal errors, these are bugs
ErrorFailedToInitializeBlueprint ServiceErrorCode = 1000
@ -120,6 +121,7 @@ func getServiceErrors() serviceErrors {
serviceError{ErrorUnsupportedImage, http.StatusBadRequest, "This compose doesn't support the creation of multiple images"},
serviceError{ErrorInvalidImageFromComposeId, http.StatusBadRequest, "Invalid format for image id"},
serviceError{ErrorImageNotFound, http.StatusBadRequest, "Image with given id not found"},
serviceError{ErrorInvalidCustomization, http.StatusBadRequest, "Invalid image customization"},
serviceError{ErrorFailedToInitializeBlueprint, http.StatusInternalServerError, "Failed to initialize blueprint"},
serviceError{ErrorFailedToGenerateManifestSeed, http.StatusInternalServerError, "Failed to generate manifest seed"},