[Pkg-owncloud-commits] [owncloud] 03/16: Properly catch 503 storage not available in getQuotaInfo

David Prévot taffit at moszumanska.debian.org
Thu Oct 30 19:55:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 3ba1441c2db2622a02d4081b07b45e0f5702ce30
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Mon Oct 27 16:27:12 2014 +0100

    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
---
 lib/private/connector/sabre/directory.php | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/private/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php
index 8815a26..0080722 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);
+		}
 	}
 
 	/**

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list