@Override
  public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
    if (exc instanceof FileSystemLoopException) {
      LOG.warn("Not indexing due to symlink loop: {}", file.toFile());
      return FileVisitResult.CONTINUE;
    } else if (exc instanceof AccessDeniedException && isExcluded(file)) {
      return FileVisitResult.CONTINUE;
    }
    throw exc;
  }
@Test
  public void test_visit_file_failed_generic_io_exception() throws IOException {
    DirectoryFileVisitor.FileVisitAction action = mock(DirectoryFileVisitor.FileVisitAction.class);

    File file = temp.newFile("failed");

    DirectoryFileVisitor underTest = new DirectoryFileVisitor(action, module, moduleExclusionFilters, inputModuleHierarchy, type);
    assertThrows(IOException.class, () -> underTest.visitFileFailed(file.toPath(), new IOException()));
  }