Fix error message 40/80240/3
authorJakub Morvay <jmorvay@frinx.io>
Fri, 8 Feb 2019 13:38:57 +0000 (14:38 +0100)
committerJakub Morvay <jakub.morvay@gmail.com>
Fri, 8 Feb 2019 14:54:36 +0000 (14:54 +0000)
This fixes obviously wrong error message propagated to user when RPC
with an input section defined is tried to be invoked without any/empty
payload.

Change-Id: I7cb6f5b6e0b7ea6fa16907d94028502957c90166
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java

index d9fd106b0706983c698ac94fd08259cb043a05b2..0f947884f49232cd56229c93d669f33dfe10d593 100644 (file)
@@ -524,9 +524,9 @@ public final class RestconfImpl implements RestconfService {
         }
 
         if (!rpc.getInput().getChildNodes().isEmpty()) {
-            LOG.debug("RPC {} does not need input value.", rpc);
-            throw new RestconfDocumentedException("RPC " + rpc + " does not take any input value.",
-                    ErrorType.RPC, ErrorTag.INVALID_VALUE);
+            LOG.debug("No input specified for RPC {} with an input section", rpc);
+            throw new RestconfDocumentedException("No input specified for RPC " + rpc
+                    + " with an input section defined", ErrorType.RPC, ErrorTag.MISSING_ELEMENT);
         }
 
         final ListenableFuture<DOMRpcResult> response;