private static RuntimeException convertException(final Exception e, final boolean logError) {
        if (e.getCause() instanceof InterruptedException) {
            // We expect interruption during searches so don't log the error.
            LOGGER.debug(e::getMessage, e);
            // Continue to interrupt the current thread.
            Thread.currentThread().interrupt();
            // Throw an unchecked form of the interrupted exception.
            return new UncheckedInterruptedException((InterruptedException) e.getCause());
        } else {
            if (logError) {
                LOGGER.error(e::getMessage, e);
            } else {
                LOGGER.debug(e::getMessage, e);
            }
            if (e instanceof RuntimeException) {
                return (RuntimeException) e;
            } else {
                return new RuntimeException(e.getMessage(), e);
            }
        }
    }
Convert a checked exception into an unchecked one. Produce useful logging and handling of interrupted exceptions.

@param e The exception to convert.
@return A runtime exception.
stroom-db-util/src/main/java/stroom/db/util/JooqUtil.java