VirtualFile (@NotNull final ConsoleRootType rootType, @NotNull String id, ScratchFileService.Option option) { final String pathName = PathUtil.makeFileName(rootType.getContentPathName(id), rootType.getDefaultFileExtension()); try { return rootType.findFile(null, pathName, option); } catch (final IOException e) { LOG.warn(e); ApplicationManager.getApplication().invokeLater(() -> { String message = ExecutionBundle.message("dialog.message.unable.to.open.file", rootType.getId(), pathName, e.getLocalizedMessage()); Messages.showErrorDialog(message, ExecutionBundle.message("dialog.title.unable.to.open.file")); }); return null; } }