Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-06-06 17:09:27 +0300
committerRobin Appelman <robin@icewind.nl>2019-06-06 17:09:27 +0300
commitb4e2d8f8adf100654a45bd7ab1d8fa3d482b7e9a (patch)
treea7ed5a5b7c6f739c67661379df651f0c63640f60 /lib/private/Files/View.php
parent07ffe4a34a9b3e63f33603a2e2bd49ea98293d88 (diff)
handle storage exceptions when trying to set mtime
not all storage backends can handle setting the mtime and they might not always handle that error correctly. Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/View.php')
-rw-r--r--lib/private/Files/View.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index fef6153fb9a..2516b782ee7 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -566,7 +566,12 @@ class View {
$hooks[] = 'create';
$hooks[] = 'write';
}
- $result = $this->basicOperation('touch', $path, $hooks, $mtime);
+ try {
+ $result = $this->basicOperation('touch', $path, $hooks, $mtime);
+ } catch (\Exception $e) {
+ $this->logger->logException($e, ['level' => ILogger::INFO, 'message' => 'Error while setting modified time']);
+ $result = false;
+ }
if (!$result) {
// If create file fails because of permissions on external storage like SMB folders,
// check file exists and return false if not.