NETCONF-509: no-input RPCs should use RestconfDocumentedException
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / restconf / impl / RestconfImpl.java
index 715d66c9552ceb43b6aa0b4c5e61c5bff89f5735..4dc8702f497c570d8530592ada6b9169f31fd141 100644 (file)
@@ -525,8 +525,8 @@ public final class RestconfImpl implements RestconfService {
 
         if (!rpc.getInput().getChildNodes().isEmpty()) {
             LOG.debug("RPC " + rpc + " does not need input value.");
-            // FIXME : find a correct Error from specification
-            throw new IllegalStateException("RPC " + rpc + " does'n need input value!");
+            throw new RestconfDocumentedException("RPC " + rpc + " does not take any input value.",
+                    ErrorType.RPC, ErrorTag.INVALID_VALUE);
         }
 
         final CheckedFuture<DOMRpcResult, DOMRpcException> response;