void ( final @NotNull Project myProject, final @NotNull List<? extends Exception> errors, final @NotNull List<? extends Exception> warnings, final @NotNull @NlsContexts.TabTitle String tabDisplayName, final @Nullable VirtualFile file) { errors.forEach(it -> { LOG.warn(tabDisplayName + " error: " + it.getMessage()); }); warnings.forEach(it -> { LOG.warn(tabDisplayName + " warning: " + it.getMessage()); }); ApplicationManager.getApplication().invokeLater(() -> { if (myProject.isDisposed()) return; if (errors.isEmpty() && warnings.isEmpty()) { ContentManagerUtil.cleanupContents(null, myProject, tabDisplayName); return; } final ErrorViewPanel errorTreeView = new ErrorViewPanel(myProject); try { openMessagesView(errorTreeView, myProject, tabDisplayName); } catch (NullPointerException e) { String errorText = ""; if (!errors.isEmpty()) { StringBuilder builder = new StringBuilder(); for (final Exception exception : errors) { builder.append("\n"); builder.append(exception.getMessage()); } errorText = ExecutionBundle.message("exception.error.text") + builder; } String warningText = ""; if (!warnings.isEmpty()) { StringBuilder builder = new StringBuilder(); for (final Exception exception : warnings) { builder.append("\n"); builder.append(exception.getMessage()); } warningText = ExecutionBundle.message("warning.error.text") + builder; } Messages.showErrorDialog(errorText + (errorText.isEmpty() || warningText.isEmpty() ? "" : "\n") + warningText, ExecutionBundle.message("execution.error")); return; } addMessages(MessageCategory.ERROR, errors, errorTreeView, file, "Unknown Error"); addMessages(MessageCategory.WARNING, warnings, errorTreeView, file, "Unknown Warning"); ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW).activate(null); }); }