public static void processException(Throwable t) {
    StartupAbortedException se = null;

    if (t instanceof StartupAbortedException) {
      se = (StartupAbortedException) t;
    } else if (t.getCause() instanceof StartupAbortedException) {
      se = (StartupAbortedException) t.getCause();
    } else if (!IdeaApplication.isLoaded()) {
      se = new StartupAbortedException(t);
    }

    if (se != null) {
      if (se.logError()) {
        try {
          if (Logger.isInitialized() && !(t instanceof ProcessCanceledException)) {
            getLogger().error(t);
          }
        } catch (Throwable ignore) {
        }

        Main.showMessage("Start Failed", t);
      }

      System.exit(se.exitCode());
    }

    if (!(t instanceof ProcessCanceledException)) {
      getLogger().error(t);
    }
  }
 @Nullable
 public static InstalledPluginsState getInstanceIfLoaded() {
   return IdeaApplication.isLoaded() ? getInstance() : null;
 }