Bug 6996: Set correct module name to error message 24/52724/2
authorAndrej Mak <andrej.mak@pantheon.tech>
Fri, 3 Mar 2017 07:08:51 +0000 (08:08 +0100)
committerAndrej Mak <andrej.mak@pantheon.tech>
Fri, 3 Mar 2017 08:16:58 +0000 (08:16 +0000)
When module doesn't exist in mountpoint schema context,
error always contained only ""yang-ext" module does not exist in mount
point." Now correct module name is set to error message.

Change-Id: Ia3299acc39b531ccfd6009d1c95c7e6e140f6624
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/ControllerContext.java

index eb4beb60af9bd25d711f1766613a3cc06b3cdb34..3e3b924cab98cfbb2aea99f3ef88fafe122982e5 100644 (file)
@@ -554,7 +554,7 @@ public class ControllerContext implements SchemaContextListener {
 
                 final Module moduleBehindMountPoint = mountPointSchema.findModuleByName(moduleNameBehindMountPoint, null);
                 if (moduleBehindMountPoint == null) {
-                    throw new RestconfDocumentedException("\"" + moduleName
+                    throw new RestconfDocumentedException("\"" + moduleNameBehindMountPoint
                             + "\" module does not exist in mount point.", ErrorType.PROTOCOL, ErrorTag.UNKNOWN_ELEMENT);
                 }