Bug 8455: Yang Patch response is not having the error details 00/57400/1
authorIvan Hrasko <ivan.hrasko@pantheon.tech>
Tue, 16 May 2017 08:55:04 +0000 (10:55 +0200)
committerIvan Hrasko <ivan.hrasko@pantheon.tech>
Fri, 19 May 2017 06:44:17 +0000 (06:44 +0000)
- add error-info to error message

Change-Id: I0d637871969ff91850749228e92bda2055c71eef
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java

index f172364e73fdfded35390b391b8fc45d234eb747..f96f75bceaa4ff2fd7924abf25b00074eae611a8 100644 (file)
@@ -115,6 +115,11 @@ public class PATCHJsonBodyWriter implements MessageBodyWriter<PATCHStatusContext
                 jsonWriter.name("error-message").value(restconfError.getErrorMessage());
             }
 
+            // optional node
+            if (restconfError.getErrorInfo() != null) {
+                jsonWriter.name("error-info").value(restconfError.getErrorInfo());
+            }
+
             jsonWriter.endObject();
         }
 
index 9a60cabc5e721e4d74468153c7e218defe8149af..65a957fef42d37aadae55d1ca76368470772fd06 100644 (file)
@@ -134,6 +134,13 @@ public class PATCHXmlBodyWriter implements MessageBodyWriter<PATCHStatusContext>
                 writer.writeCharacters(restconfError.getErrorMessage());
                 writer.writeEndElement();
             }
+
+            // optional node
+            if (restconfError.getErrorInfo() != null) {
+                writer.writeStartElement("error-info");
+                writer.writeCharacters(restconfError.getErrorInfo());
+                writer.writeEndElement();
+            }
         }
 
         writer.writeEndElement();