public static Throwable getRootCause(Throwable throwable) {
        Throwable cause = throwable;
        while (cause.getCause() != null) {
            cause = cause.getCause();
        }
        return cause;
    }
Convert a {@link Exception} to a {@link SQLException}.
@param message Custom message to use
@param cause {@link Exception} to convert
@return Converted {@link SQLException}
jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/ExceptionUtils.java