void (@NotNull VirtualFile fileOrDir, List<? extends IndexableFileScanner.IndexableFileVisitor> sessions) { for (IndexableFileScanner.IndexableFileVisitor session : sessions) { try { session.visitFile(fileOrDir); } catch (ProcessCanceledException e) { throw e; } catch (Exception e) { LOG.error("Failed to visit file", e, new Attachment("filePath.txt", fileOrDir.getPath())); } } }