public static RuntimeException handleExceptionsOnNodeCall(final String nodeName,
                                                              final String url,
                                                              final Throwable throwable) {
        if (throwable instanceof WebApplicationException) {
            throw (WebApplicationException) throwable;
        } else if (throwable instanceof ProcessingException) {
            if (throwable.getCause() != null && throwable.getCause() instanceof ConnectException) {
                return new NodeCallException(nodeName, url, throwable);
            } else {
                return new RuntimeException(throwable);
            }
        } else {
            return new RuntimeException(throwable);
        }
    }
@param nodeName The name of the node to get the base endpoint for
@return The base endpoint url for inter-node communications, e.g. http://some-fqdn:8080
stroom-node/stroom-node-api/src/main/java/stroom/node/api/NodeCallUtil.java