From e35a2e4f5010a8fdc740c312a005aa9a6ef1bd04 Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Thu, 3 Oct 2024 13:26:34 +0200 Subject: [PATCH] Do not produce warning when file is not found during search Signed-off-by: Jakub Onderka --- lib/Service/SearchService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php index 61a6404..a124d9a 100644 --- a/lib/Service/SearchService.php +++ b/lib/Service/SearchService.php @@ -33,6 +33,7 @@ use ArtificialOwl\MySmallPhpTools\Traits\TPathTools; use Exception; +use OCA\Files_FullTextSearch\Exceptions\FilesNotFoundException; use OCA\Files_FullTextSearch\Model\FilesDocument; use OCP\Files\FileInfo; use OCP\Files\IMimeTypeDetector; @@ -212,6 +213,8 @@ public function improveSearchResult(ISearchResult $searchResult) { ); $filesDocuments[] = $filesDocument; + } catch (FilesNotFoundException $e) { + // ignore exception when file is not accessible for current user } catch (Exception $e) { $this->logger->warning('Exception while improving searchresult', ['exception' => $e]); }