summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-11-13 14:13:16 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-11-17 10:39:52 +0100
commite2cfcd992cf6f4bb5f1cdb9070d3d0ea2a1504e2 (patch)
tree5808454fe5247f027d6244697b794a7307e5be4b /lib/private
parent705d208a8aba55cdb509380db19a0b4e2413d1eb (diff)
downloadnextcloud-server-e2cfcd992cf6f4bb5f1cdb9070d3d0ea2a1504e2.tar.gz
nextcloud-server-e2cfcd992cf6f4bb5f1cdb9070d3d0ea2a1504e2.zip
Allow storage wrappers to through a forbidden exception with retry information
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/cache/file.php2
-rw-r--r--lib/private/files.php5
-rw-r--r--lib/private/files/cache/scanner.php2
3 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php
index 1cda05f28e5..31d4718d18a 100644
--- a/lib/private/cache/file.php
+++ b/lib/private/cache/file.php
@@ -185,6 +185,8 @@ class File implements ICache {
} catch (\OCP\Lock\LockedException $e) {
// ignore locked chunks
\OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core'));
+ } catch (\OCP\Files\ForbiddenException $e) {
+ \OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "' . $file . '"', array('app' => 'core'));
} catch (\OCP\Files\LockNotAcquiredException $e) {
\OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core'));
}
diff --git a/lib/private/files.php b/lib/private/files.php
index 9be5fc9a12f..af10f3e1e32 100644
--- a/lib/private/files.php
+++ b/lib/private/files.php
@@ -142,6 +142,11 @@ class OC_Files {
$l = \OC::$server->getL10N('core');
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : '';
\OC_Template::printErrorPage($l->t('File is currently busy, please try again later'), $hint);
+ } catch (\OCP\Files\ForbiddenException $ex) {
+ self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
+ OC::$server->getLogger()->logException($ex);
+ $l = \OC::$server->getL10N('core');
+ \OC_Template::printErrorPage($l->t('Can\'t read file'), $ex->getMessage());
} catch (\Exception $ex) {
self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
OC::$server->getLogger()->logException($ex);
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index 35043029dc3..983e12d7639 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -432,6 +432,8 @@ class Scanner extends BasicEmitter {
// skip unavailable storages
} catch (\OCP\Files\StorageNotAvailableException $e) {
// skip unavailable storages
+ } catch (\OCP\Files\ForbiddenException $e) {
+ // skip forbidden storages
} catch (\OCP\Lock\LockedException $e) {
// skip unavailable storages
}