Updating exception and explanation for update node leaves
[cps.git] / cps-service / src / main / java / org / onap / cps / utils / YangUtils.java
index 0b66d37..b5c14a0 100644 (file)
@@ -94,9 +94,13 @@ public class YangUtils {
             final var jsonReader = new JsonReader(new StringReader(jsonData));
             jsonParserStream.parse(jsonReader);
 
-        } catch (final IOException | IllegalStateException | JsonSyntaxException exception) {
+        } catch (final IOException | JsonSyntaxException exception) {
             throw new DataValidationException(
-                    "Failed to parse json data: " + jsonData,  exception.getMessage(), exception);
+                "Failed to parse json data: " + jsonData, exception.getMessage(), exception);
+        } catch (final IllegalStateException illegalStateException) {
+            throw new DataValidationException(
+                "Failed to parse json data. Unsupported xpath or json data:" + jsonData, illegalStateException
+                .getMessage(), illegalStateException);
         }
         return normalizedNodeResult.getResult();
     }