]> source.dussan.org Git - nextcloud-server.git/commitdiff
A failed storage is a not available storage
authorRoeland Jago Douma <roeland@famdouma.nl>
Thu, 30 Nov 2017 20:29:06 +0000 (21:29 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 6 Dec 2017 08:15:43 +0000 (09:15 +0100)
We have to double check. Since getting the info of the root returns a
generic entry. But actually the stroage is not available. Else we get
very weird sync and web behavior.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/lib/Connector/Sabre/ObjectTree.php

index acc6dcc3be3cffaefc123379081cf946633b37d3..f37ffc19e290a665ed650a9d3c69a51579e76342 100644 (file)
@@ -29,6 +29,7 @@
 
 namespace OCA\DAV\Connector\Sabre;
 
+use OC\Files\Storage\FailedStorage;
 use OCA\DAV\Connector\Sabre\Exception\Forbidden;
 use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
 use OCA\DAV\Connector\Sabre\Exception\FileLocked;
@@ -158,6 +159,10 @@ class ObjectTree extends \Sabre\DAV\Tree {
                        // read from cache
                        try {
                                $info = $this->fileView->getFileInfo($path);
+
+                               if ($info->getStorage()->instanceOfStorage(FailedStorage::class)) {
+                                       throw new StorageNotAvailableException();
+                               }
                        } catch (StorageNotAvailableException $e) {
                                throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage is temporarily not available');
                        } catch (StorageInvalidException $e) {