diff --git a/pvAccessJava/src/org/epics/pvaccess/client/rpc/RPCClientImpl.java b/pvAccessJava/src/org/epics/pvaccess/client/rpc/RPCClientImpl.java index 21dc68ac5..75e24c1e6 100644 --- a/pvAccessJava/src/org/epics/pvaccess/client/rpc/RPCClientImpl.java +++ b/pvAccessJava/src/org/epics/pvaccess/client/rpc/RPCClientImpl.java @@ -129,10 +129,11 @@ public PVStructure request(PVStructure pvArgument, double timeout) return result; else { - if (status.getStackDump() == null) - throw new RPCRequestException(status.getType(), status.getMessage()); + String stackDump = status.getStackDump(); + if (stackDump != null && !stackDump.isEmpty()) + throw new RPCRequestException(status.getType(), status.getMessage() + ", cause:\n" + stackDump); else - throw new RPCRequestException(status.getType(), status.getMessage() + ", cause:\n" + status.getStackDump()); + throw new RPCRequestException(status.getType(), status.getMessage()); } } else diff --git a/pvAccessJava/src/org/epics/pvaccess/server/impl/remote/rpc/ServerRPCService.java b/pvAccessJava/src/org/epics/pvaccess/server/impl/remote/rpc/ServerRPCService.java index 37ddf8f85..797d954d2 100644 --- a/pvAccessJava/src/org/epics/pvaccess/server/impl/remote/rpc/ServerRPCService.java +++ b/pvAccessJava/src/org/epics/pvaccess/server/impl/remote/rpc/ServerRPCService.java @@ -288,7 +288,8 @@ public PVStructure execute() throws RPCRequestException { if (!status.isSuccess()) { String errorMessage = "failed to fetch channel list: " + status.getMessage(); - if (status.getStackDump() != null) + String stackDump = status.getStackDump(); + if (stackDump != null && !stackDump.isEmpty()) errorMessage += "\n" + status.getStackDump(); throw new RPCRequestException(StatusType.ERROR, errorMessage); }