diff options
Diffstat (limited to 'src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java')
-rw-r--r-- | src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java | 10 |
1 files changed, 7 insertions, 3 deletions
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); } } |