X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FRemoteRpcImplementation.java;h=2a4ea2e3e6d6208a371cdb163de9ec3344df89df;hb=6e0016fba14509df5eff3314c70401c5491b2ccc;hp=a6fdfd3ff97445a2f28cd48e077d66e22fd24f38;hpb=6dcee56392712348b1abdcdc0d1d5f94dfcf505c;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java index a6fdfd3ff9..2a4ea2e3e6 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java @@ -64,10 +64,14 @@ public class RemoteRpcImplementation implements DOMRpcImplementation { LOG.debug("Detailed Error", failure); } - final String message = String.format("Execution of RPC %s failed", rpcMsg.getRpc()); - Collection errors = ((RpcErrorsException)failure).getRpcErrors(); - if(errors == null || errors.size() == 0) { - errors = Arrays.asList(RpcResultBuilder.newError(ErrorType.RPC, null, message)); + final String message = String.format("Execution of RPC %s failed because of %s", + rpcMsg.getRpc(), failure.getMessage()); + Collection errors = Arrays.asList(RpcResultBuilder.newError(ErrorType.RPC, null, message)); + if(failure instanceof RpcErrorsException) { + errors = ((RpcErrorsException) failure).getRpcErrors(); + if (errors == null || errors.size() == 0) { + errors = Arrays.asList(RpcResultBuilder.newError(ErrorType.RPC, null, message)); + } } final DOMRpcResult rpcResult = new DefaultDOMRpcResult(errors); @@ -76,8 +80,16 @@ public class RemoteRpcImplementation implements DOMRpcImplementation { } final RpcResponse rpcReply = (RpcResponse)reply; - final NormalizedNode result = - NormalizedNodeSerializer.deSerialize(rpcReply.getResultNormalizedNode()); + final NormalizedNode result; + + if(rpcReply.getResultNormalizedNode() == null){ + result = null; + LOG.debug("Received response for invoke rpc : {} result is null", rpcMsg.getRpc()); + } else { + result = NormalizedNodeSerializer.deSerialize(rpcReply.getResultNormalizedNode()); + LOG.debug("Received response for invoke rpc : {} result : {}", rpcMsg.getRpc(), result); + } + settableFuture.set(new DefaultDOMRpcResult(result)); } };