void (final boolean isEmpty, final Supplier<? extends VcsException> firstGetter, @NotNull @NlsContexts.TabTitle String tabDisplayName, final Consumer<? super VcsErrorViewPanel> viewFiller) { if (ApplicationManager.getApplication().isUnitTestMode()) { if (!isEmpty) { VcsException exception = firstGetter.get(); if (!handleCustom(exception)) { throw new RuntimeException(exception); } } return; } ApplicationManager.getApplication().invokeLater(() -> { if (myProject.isDisposed()) return; if (isEmpty) { ContentManagerUtil.cleanupContents(null, myProject, tabDisplayName); return; } final VcsErrorViewPanel errorTreeView = new VcsErrorViewPanel(myProject); openMessagesView(errorTreeView, tabDisplayName); viewFiller.consume(errorTreeView); }); }