Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-27 18:27:12 +0300
committerVincent Petry <pvince81@owncloud.com>2014-10-28 11:53:24 +0300
commit3ba1441c2db2622a02d4081b07b45e0f5702ce30 (patch)
treecf0e2f46fea88412cbb7e1bc1e891a6d3996d7ec /lib/private/connector
parentdbfe5ef28acfc54c4f025b7fa1427113c961f5cf (diff)
Properly catch 503 storage not available in getQuotaInfo
When doing a PROPFIND on the root and one of the mount points is not available, the returned quota attributes will now be zero. This fix prevents the expected exception to make the whole call fail. Backport of 21d825ed6c11425d36a143f8ed63f1e3852d0aeb from master
Diffstat (limited to 'lib/private/connector')
-rw-r--r--lib/private/connector/sabre/directory.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/private/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php
index 8815a261db8..00807224c24 100644
--- a/lib/private/connector/sabre/directory.php
+++ b/lib/private/connector/sabre/directory.php
@@ -205,13 +205,17 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node
* @return array
*/
public function getQuotaInfo() {
- $path = \OC\Files\Filesystem::getView()->getRelativePath($this->info->getPath());
- $storageInfo = OC_Helper::getStorageInfo($path);
- return array(
- $storageInfo['used'],
- $storageInfo['free']
- );
-
+ try {
+ $path = \OC\Files\Filesystem::getView()->getRelativePath($this->info->getPath());
+ $storageInfo = OC_Helper::getStorageInfo($path);
+ return array(
+ $storageInfo['used'],
+ $storageInfo['free']
+ );
+ }
+ catch (\OCP\Files\StorageNotAvailableException $e) {
+ return array(0, 0);
+ }
}
/**