Provide the reason why data is not compliant 83/119783/2
authorBruno Sakoto <bruno.sakoto@bell.ca>
Sat, 13 Mar 2021 00:21:55 +0000 (19:21 -0500)
committerRishi Chail <rishi.chail@est.tech>
Mon, 29 Mar 2021 09:50:55 +0000 (09:50 +0000)
Issue-ID: CPS-292
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: Ia58a8dfcf427e373b24bb3be7436abf6abd55492

cps-service/src/main/java/org/onap/cps/utils/YangUtils.java

index 733378e..2c6bc1c 100644 (file)
@@ -93,9 +93,9 @@ public class YangUtils {
             final JsonReader jsonReader = new JsonReader(new StringReader(jsonData));
             jsonParserStream.parse(jsonReader);
 
-        } catch (final IOException | IllegalStateException e) {
-            throw new DataValidationException("Failed to parse json data.", String
-                .format("Exception occurred on parsing string %s.", jsonData), e);
+        } catch (final IOException | IllegalStateException exception) {
+            throw new DataValidationException(
+                    "Failed to parse json data: " + jsonData,  exception.getMessage(), exception);
         }
         return normalizedNodeResult.getResult();
     }