From d20c5616507c0ecb41bc7cc7b44540392bc5ad32 Mon Sep 17 00:00:00 2001 From: Edyta Krukowska Date: Mon, 12 Oct 2020 13:15:21 +0200 Subject: Add logs from external-repo-manager lib Issue-ID: DCAEGEN2-2478 Signed-off-by: Edyta Krukowska Change-Id: If6f4ab2c8fd9a4bf14e2391acc54eb7b25689e21 --- .../onap/dcae/common/validator/StndDefinedDataValidator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java') diff --git a/src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java b/src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java index d936f272..20890f01 100644 --- a/src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java +++ b/src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java @@ -29,6 +29,8 @@ import org.onap.dcae.restapi.EventValidatorException; import org.onap.dcaegen2.services.sdk.services.external.schema.manager.exception.IncorrectInternalFileReferenceException; import org.onap.dcaegen2.services.sdk.services.external.schema.manager.exception.NoLocalReferenceException; import org.onap.dcaegen2.services.sdk.services.external.schema.manager.service.StndDefinedValidator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -39,6 +41,8 @@ public class StndDefinedDataValidator { private final StndDefinedValidator stndDefinedValidator; + public static final Logger log = LoggerFactory.getLogger(StndDefinedDataValidator.class); + @Autowired public StndDefinedDataValidator(StndDefinedValidator validator) { this.stndDefinedValidator = validator; @@ -56,7 +60,7 @@ public class StndDefinedDataValidator { throw new EventValidatorException(ApiException.STND_DEFINED_VALIDATION_FAILED); } } catch (JsonProcessingException ex) { - throw new EventValidatorException(ApiException.INVALID_JSON_INPUT); + throw new EventValidatorException(ApiException.INVALID_JSON_INPUT, ex); } } @@ -64,9 +68,9 @@ public class StndDefinedDataValidator { try { return stndDefinedValidator.validate(event); } catch (NoLocalReferenceException e) { - throw new EventValidatorException(ApiException.NO_LOCAL_SCHEMA_REFERENCE); + throw new EventValidatorException(ApiException.NO_LOCAL_SCHEMA_REFERENCE, e); } catch (IncorrectInternalFileReferenceException e) { - throw new EventValidatorException(ApiException.INCORRECT_INTERNAL_FILE_REFERENCE); + throw new EventValidatorException(ApiException.INCORRECT_INTERNAL_FILE_REFERENCE, e); } } -- cgit 1.2.3-korg