diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-10-27 18:27:12 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-10-28 11:53:24 +0300 |
commit | 3ba1441c2db2622a02d4081b07b45e0f5702ce30 (patch) | |
tree | cf0e2f46fea88412cbb7e1bc1e891a6d3996d7ec /lib | |
parent | dbfe5ef28acfc54c4f025b7fa1427113c961f5cf (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')
-rw-r--r-- | lib/private/connector/sabre/directory.php | 18 |
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); + } } /** |