summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-18 09:13:45 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-18 09:13:45 +0100
commitaba119951ebe2d552458a5bd184a66319937fd17 (patch)
tree2301e65ff13f7f3f6604a71db95a431fbde49ac9 /lib/private
parent11f123c7d86b6327e89e1ec158551d0b9e5e9741 (diff)
parente2cfcd992cf6f4bb5f1cdb9070d3d0ea2a1504e2 (diff)
downloadnextcloud-server-aba119951ebe2d552458a5bd184a66319937fd17.tar.gz
nextcloud-server-aba119951ebe2d552458a5bd184a66319937fd17.zip
Merge pull request #20494 from owncloud/storage-forbidden-exception
Allow storage wrappers to through a forbidden exception with retry information for clients
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
}