public static String unwrapMessage(final Throwable rootEx, final Throwable e) {
        if (e instanceof java.sql.SQLException) {
            return "Unable to save record state: " + e.getMessage();
        }
        if (e instanceof EntityServiceException) {
            return e.getMessage();
        }
        if (e.getCause() != null) {
            return unwrapMessage(rootEx, e.getCause());
        }
        return getDefaultMessage(e, rootEx);
    }
Unwrap an exception and log it if required.
stroom-util/src/main/java/stroom/util/EntityServiceExceptionUtil.java