From 15f1962c343287bdd85c6897ed067e0489cc3bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Mon, 6 Feb 2023 11:59:45 +0100 Subject: [PATCH] Cloud API: add error for failed customization validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/cloudapi/v2/errors.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/cloudapi/v2/errors.go b/internal/cloudapi/v2/errors.go index 4de43415d..15cc5d3fe 100644 --- a/internal/cloudapi/v2/errors.go +++ b/internal/cloudapi/v2/errors.go @@ -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"},