A failed storage is a not available storage

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>
This commit is contained in:
Roeland Jago Douma 2017-11-30 21:29:06 +01:00
parent 567757c793
commit c8a29ec942
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 0 deletions

View File

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