private @Nullable Exception executeCommand(@NotNull @NlsContexts.Command String commandName, @NotNull ThrowableRunnable<? extends Exception> invokeCreate) {
    final Exception[] exception = new Exception[1];
    CommandProcessor.getInstance().executeCommand(myProject, () -> {
      LocalHistoryAction action = LocalHistory.getInstance().startAction(commandName);
      try {
        if (startInWriteAction()) {
          WriteAction.run(invokeCreate);
        }
        else {
          invokeCreate.run();
        }
      }
      catch (Exception ex) {
        exception[0] = ex;
      }
      finally {
        action.finish();
      }
    }, commandName, null, UndoConfirmationPolicy.REQUEST_CONFIRMATION);
    return exception[0];
  }
private @Nullable Exception executeCommand(@NotNull @NlsContexts.Command String commandName, @NotNull ThrowableRunnable<? extends Exception> invokeCreate)