diff --git a/apps/files/lib/Command/ScanAppData.php b/apps/files/lib/Command/ScanAppData.php
index 365e2e3cb2e..6ad83d9a182 100644
--- a/apps/files/lib/Command/ScanAppData.php
+++ b/apps/files/lib/Command/ScanAppData.php
@@ -128,6 +128,8 @@ class ScanAppData extends Base {
} catch (InterruptedException $e) {
# exit the function if ctrl-c has been pressed
$output->writeln('Interrupted by user');
+ } catch (NotFoundException $e) {
+ $output->writeln('Path not found: ' . $e->getMessage() . '');
} catch (\Exception $e) {
$output->writeln('Exception during scan: ' . $e->getMessage() . '');
$output->writeln('' . $e->getTraceAsString() . '');
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index f845ac31fe2..5d126f2bcc3 100644
--- a/lib/private/Files/Utils/Scanner.php
+++ b/lib/private/Files/Utils/Scanner.php
@@ -162,6 +162,7 @@ class Scanner extends PublicEmitter {
/**
* @param string $dir
* @throws \OC\ForbiddenException
+ * @throws \OCP\Files\NotFoundException
*/
public function scan($dir = '') {
if (!Filesystem::isValidPath($dir)) {