aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java
diff options
context:
space:
mode:
authorEdyta Krukowska <edyta.krukowska@nokia.com>2020-10-12 13:15:21 +0200
committerEdyta Krukowska <edyta.krukowska@nokia.com>2020-10-16 09:11:59 +0000
commit4846c92177fb3e437e678c4abdf4733ab0b7a0f2 (patch)
treef98b7970b90f13ae5c0edefaac473e66668d193f /src/main/java/org/onap/dcae/common/validator/StndDefinedDataValidator.java
parent72c913d96d76ecce08a92e3794b22e4e6e88a85f (diff)
Add logs from external-repo-manager lib
Issue-ID: DCAEGEN2-2478 Signed-off-by: Edyta Krukowska <edyta.krukowska@nokia.com> Change-Id: If6f4ab2c8fd9a4bf14e2391acc54eb7b25689e21
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.java10
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);
}
}