When invoked with an "input" value currently the implementation throws
IllegalStateException up to the servlet container which results in the
ugly jetty default error page and reveals stack trace information.
Provide a clear message that the invoked RPC should not take any input values.
Change-Id: Id13499b80bed9a2ea7666a3aa6d775da341055ab
Signed-off-by: Evan Zeller <evanrzeller@gmail.com>
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;