Skip to content

Commit 3f0d1f8

Browse files
committed
fix(IndexerJob): Add try catch
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent d8ef780 commit 3f0d1f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/BackgroundJobs/IndexerJob.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ protected function index(array $files): void {
265265
$emptyInvalidSources = array_diff($allSourceIds, $loadedSources);
266266
if (count($emptyInvalidSources) > 0) {
267267
$this->logger->info('Invalid or empty sources that were not indexed (n=' . count($emptyInvalidSources) . ')', ['sourceIds' => $emptyInvalidSources]);
268-
$this->logger->info('Invalid or empty files that were not indexed: ' . json_encode(array_map(fn ($sourceId) => $this->rootFolder->getFirstNodeById(intval(explode(' ', $sourceId)[1]))->getPath(), $emptyInvalidSources)));
268+
try {
269+
$this->logger->info('Invalid or empty files that were not indexed: ' . json_encode(array_map(fn ($sourceId) => $this->rootFolder->getFirstNodeById(intval(explode(' ', $sourceId)[1]))->getPath(), $emptyInvalidSources), \JSON_THROW_ON_ERROR));
270+
} catch (\Exception $e) {
271+
$this->logger->warning('Could not get invalid or empty files that were not indexed', ['exception' => $e]);
272+
}
269273
}
270274

271275
try {

0 commit comments

Comments
 (0)