public static ProcessException wrap(final Throwable throwable) {
        if (throwable instanceof ProcessException) {
            return (ProcessException) throwable;
        }
        if (throwable instanceof XPathException) {
            return new ProcessException((XPathException) throwable);
        }
        if (throwable instanceof UncheckedXPathException) {
            return new ProcessException(((UncheckedXPathException) throwable).getXPathException());
        }
        return new ProcessException(new XPathException(throwable));
    }
Exception used to wrap all exceptions generated within transformation code.
stroom-pipeline/src/main/java/stroom/pipeline/errorhandler/ProcessException.java