private @Nullable <T> T executeBackgroundTask(Callable<T> task,
                                                boolean waitForResult,
                                                @NlsContexts.ProgressTitle String userVisibleMessage,
                                                String errorLogMessage)
    throws PyDebuggerException {
    final FutureResult<T> future = new FutureResult<>();
    new Task.Backgroundable(myProject, userVisibleMessage, false) {
      @Override
      public void run(@NotNull ProgressIndicator indicator) {
        try {
          T result = task.call();
          future.set(result);
        }
        catch (PythonUnhandledException e) {
          LOG.error(errorLogMessage + e.traceback);
          future.set(null);
        }
        catch (Exception e) {
          future.setException(e);
        }
      }
    }.queue();
    if (waitForResult) {
      try {
        return future.get();
      }
      catch (InterruptedException | ExecutionException e) {
        throw new PyDebuggerException(errorLogMessage + e.getMessage(), e);
      }
    }
    return null;
  }
private @Nullable <T> T executeBackgroundTask(Callable<T> task,
                                                boolean waitForResult,
                                                @NlsContexts.ProgressTitle String userVisibleMessage,
                                                String errorLogMessage)