Browse Source

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.
tags/v8.0.0alpha1
Vincent Petry 9 years ago
parent
commit
21d825ed6c
1 changed files with 11 additions and 7 deletions
  1. 11
    7
      lib/private/connector/sabre/directory.php

+ 11
- 7
lib/private/connector/sabre/directory.php View File

@@ -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);
}
}

/**

Loading…
Cancel
Save