summaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-01-28 00:31:37 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-01-28 00:31:37 +0100
commit87b39e8f03913f6e571c526167c18f0be0021c41 (patch)
treea190a15c3549c53dcc263ccd41334507d9865caa /lib/private/files/view.php
parent3fa6e0f4dca7f477e93b10287f7de5cc75d39275 (diff)
parent5376b0b123873269a92d9aa45f6233c48c2720df (diff)
downloadnextcloud-server-87b39e8f03913f6e571c526167c18f0be0021c41.tar.gz
nextcloud-server-87b39e8f03913f6e571c526167c18f0be0021c41.zip
Merge pull request #13525 from owncloud/s2s-fixscanfileforbrokenstorage
Catch storage exception in scanner for remote shares
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index f466361bd02..096d8044b75 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -1044,7 +1044,22 @@ class View {
if ($subCache->getStatus('') === Cache\Cache::NOT_FOUND) {
$subScanner = $subStorage->getScanner('');
- $subScanner->scanFile('');
+ try {
+ $subScanner->scanFile('');
+ } catch (\OCP\Files\StorageNotAvailableException $e) {
+ continue;
+ } catch (\OCP\Files\StorageInvalidException $e) {
+ continue;
+ } catch (\Exception $e) {
+ // sometimes when the storage is not available it can be any exception
+ \OCP\Util::writeLog(
+ 'core',
+ 'Exception while scanning storage "' . $subStorage->getId() . '": ' .
+ get_class($e) . ': ' . $e->getMessage(),
+ \OCP\Util::ERROR
+ );
+ continue;
+ }
}
$rootEntry = $subCache->get('');