diff --git a/lib/Service/FilesService.php b/lib/Service/FilesService.php index 8dbaf34..301276d 100644 --- a/lib/Service/FilesService.php +++ b/lib/Service/FilesService.php @@ -412,10 +412,14 @@ private function generateFilesDocumentFromFile(string $viewerId, Node $file): Fi $ownerId = ''; } - $document->setType($file->getType()) - ->setOwnerId($ownerId) - ->setPath($this->getPathFromViewerId($file->getId(), $viewerId)) - ->setViewerId($viewerId); + try { + $document->setType($file->getType()) + ->setOwnerId($ownerId) + ->setPath($this->getPathFromViewerId($file->getId(), $viewerId)) + ->setViewerId($viewerId); + } catch (Throwable $t) { + throw new FileIsNotIndexableException(); + } if ($file->getMimetype() !== null) { $document->setMimetype($file->getMimetype()); @@ -779,7 +783,7 @@ private function updateShareNames(FilesDocument $document, Node $file): array { $shareNames[$this->miscService->secureUsername($username)] = (!is_string($path)) ? $path = '' : $path; - } catch (Exception $e) { + } catch (Throwable $e) { $this->miscService->log( 'Issue while getting information on documentId:' . $document->getId(), 0 );