summaryrefslogtreecommitdiffstats
path: root/lib/private/connector
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-27 16:27:12 +0100
committerVincent Petry <pvince81@owncloud.com>2014-10-27 16:27:12 +0100
commit21d825ed6c11425d36a143f8ed63f1e3852d0aeb (patch)
tree820463d383212b438f8a057068c29ea6a555c21e /lib/private/connector
parent5d391910c52309d7c538a2494927b3720dc06d0a (diff)
downloadnextcloud-server-21d825ed6c11425d36a143f8ed63f1e3852d0aeb.tar.gz
nextcloud-server-21d825ed6c11425d36a143f8ed63f1e3852d0aeb.zip
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.
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 1b6d1f363b8..0d35c7d528e 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);
+ }
}
/**