Runnable (@NotNull final GithubProjectGeneratorPeer peer) { return () -> { if (ApplicationManager.getApplication().isUnitTestMode()) { peer.onTagsUpdated(Collections.emptySet()); return; } final String[] urls = formatTagListDownloadUrls(); @NlsContexts.DialogMessage String firstErrorMessage = null; for (String url : urls) { @NlsContexts.DialogMessage String errorMessage; try { final ImmutableSet<GithubTagInfo> tags = fetchGithubTagsByUrl(url); LOG.info(getGeneratorName() + "Cache has been successfully updated"); UIUtil.invokeLaterIfNeeded(() -> peer.onTagsUpdated(tags)); return; } catch (IOException e) { errorMessage = LangBundle.message("dialog.message.can.not.fetch.tags.from", url); LOG.warn(getGeneratorName() + errorMessage, e); } catch (GeneratorException e) { errorMessage = LangBundle.message("dialog.message.malformed.json.received.from", url); LOG.warn(getGeneratorName() + errorMessage, e); } if (firstErrorMessage == null) { firstErrorMessage = errorMessage; } } if (firstErrorMessage != null) { peer.onTagsUpdateError(firstErrorMessage); } }; }