diff options
author | Pavel Aharoni <pa0916@att.com> | 2017-05-24 13:23:12 +0300 |
---|---|---|
committer | Pavel Aharoni <pa0916@att.com> | 2017-05-24 13:23:12 +0300 |
commit | 9e430cd9d4722c3e614c8a2fd822cff1604be1f2 (patch) | |
tree | 565af8e16f17ae46bc901093aded0e19ac1b4c1f /jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java | |
parent | 67a7f1d57b6b1d7c07dc3da4db51a387f90fef28 (diff) |
[SDC-24] error handling
Change-Id: Iac97052fab32f638d4cf52b094caad31f6d76902
Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java')
-rw-r--r-- | jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java b/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java index a081f89..350068b 100644 --- a/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java +++ b/jtosca/src/main/java/org/openecomp/sdc/toscaparser/api/DataEntity.java @@ -11,6 +11,7 @@ import org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint; import org.openecomp.sdc.toscaparser.api.elements.constraints.Schema; import org.openecomp.sdc.toscaparser.api.functions.Function; import org.openecomp.sdc.toscaparser.api.utils.TOSCAVersionProperty; +import org.openecomp.sdc.toscaparser.api.utils.ThreadLocalsHolder; import org.openecomp.sdc.toscaparser.api.utils.ValidateUtils; public class DataEntity { @@ -49,7 +50,7 @@ public class DataEntity { else { if(!(value instanceof LinkedHashMap)) { //ERROR under investigation - ExceptionCollector.appendWarning(String.format( + ThreadLocalsHolder.getCollector().appendWarning(String.format( "TypeMismatchError: \"%s\" is not a map. The type is \"%s\"", value.toString(),dataType.getType())); @@ -85,7 +86,7 @@ public class DataEntity { for(String valueKey: valueDict.keySet()) { //1710 devlop JSON validation if(!("json").equals(dataType.getType()) && !allowedProps.contains(valueKey)) { - ExceptionCollector.appendException(String.format( + ThreadLocalsHolder.getCollector().appendException(String.format( "UnknownFieldError: Data value of type \"%s\" contains unknown field \"%s\"", dataType.getType(),valueKey)); } @@ -108,7 +109,7 @@ public class DataEntity { } } if(missingProp.size() > 0) { - ExceptionCollector.appendWarning(String.format( + ThreadLocalsHolder.getCollector().appendWarning(String.format( "MissingRequiredFieldError: Data value of type \"%s\" is missing required field(s) \"%s\"", dataType.getType(),missingProp.toString())); } @@ -168,7 +169,7 @@ public class DataEntity { } else if (type == null) { //NOT ANALYZED - ExceptionCollector.appendWarning(String.format( + ThreadLocalsHolder.getCollector().appendWarning(String.format( "MissingType: Type is missing for value \"%s\"", value.toString())); return value; |