From 7be0ab69d0828950c1601566ae9857a104e7124d Mon Sep 17 00:00:00 2001 From: Bartosz Gardziejewski Date: Tue, 18 Aug 2020 13:31:29 +0200 Subject: Wrap exceptions connected with Yaml parsing in order to send them as validation error. Signed-off-by: Bartosz Gardziejewski Change-Id: Iae6c0948746bb903945de1796b6f42952d4072ba Issue-ID: VNFSDK-644 --- .../main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'csarvalidation/src/main/java/org/onap') diff --git a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java index f1bbffc..a929418 100644 --- a/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java +++ b/csarvalidation/src/main/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR816745.java @@ -24,6 +24,7 @@ import org.onap.validation.yaml.error.YamlDocumentValidationError; import org.onap.validation.yaml.exception.YamlProcessingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.error.YAMLException; import java.nio.file.Path; import java.util.List; @@ -83,7 +84,7 @@ public class VTPValidateCSARR816745 extends VTPValidateCSARBase { List validationErrors = new YamlFileValidator().validateYamlFileWithSchema(rootPath+artifactPath); addAllErrorsReportedByVaidator(artifactPath, validationErrors); - } catch (YamlProcessingException e) { + } catch (YamlProcessingException | YAMLException e) { LOGGER.error("Failed to load PM_Dictionary file.", e); errors.add(new CSARPmDictionaryLoadingError( artifactPath, -- cgit 1.2.3-korg