private void notifyOfGenerationFailure(@NotNull Exception exception, @NotNull Sdk sdk) {
      if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
        LOG.warn(exception);
        return;
      }
      if (exception instanceof UnsupportedPythonSdkTypeException) {
        NotificationGroupManager.getInstance().getNotificationGroup(NOTIFICATION_GROUP_ID)
          .createNotification(PyBundle.message("sdk.gen.failed.notification.title"),
                              PyBundle.message("remote.interpreter.support.is.not.available", sdk.getName()),
                              NotificationType.WARNING)
          .notify(myProject);
      }
      else if (exception instanceof InvalidSdkException) {
        if (PythonSdkUtil.isRemote(mySdk)) {
          PythonSdkType.notifyRemoteSdkSkeletonsFail((InvalidSdkException)exception, () -> {
            if (!isSdkDisposed()) {
              update(mySdk, myProject, null);
            }
          });
        }
        else if (PySdkExtKt.getSdkSeemsValid(sdk)) {
          LOG.error(exception);
        }
      }
    }
private void notifyOfGenerationFailure(@NotNull Exception exception, @NotNull Sdk sdk)