From 1cf4f4a00bd4503bb1607f101f9d9050c326c66e Mon Sep 17 00:00:00 2001 From: Pavel Artsishevsky Date: Fri, 22 Apr 2022 21:59:22 +0300 Subject: [PATCH] merged errors handling from polter-rnd --- lib/Tools/folderScan.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Tools/folderScan.php b/lib/Tools/folderScan.php index 8159acb..98c2d4a 100644 --- a/lib/Tools/folderScan.php +++ b/lib/Tools/folderScan.php @@ -53,8 +53,10 @@ class folderScan try { $this->scanner->scan($this->path); return ['status' => true, 'path' => $this->path]; - } catch (ForbiddenException $e) { + } catch (\OCP\Files\ForbiddenException $e) { $this->logger->warning("Make sure you're running the scan command only as the user the web server runs as"); + } catch (\OCP\Files\NotFoundException $e) { + $this->logger->warning("Path for the scan command not found: " . $e->getMessage()); } catch (\Exception $e) { $this->logger->warning("Exception during scan: " . $e->getMessage() . $e->getTraceAsString()); }