From: Robin Appelman Date: Thu, 6 Jun 2019 14:09:27 +0000 (+0200) Subject: handle storage exceptions when trying to set mtime X-Git-Tag: v16.0.2RC1~17^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=42930f6fab01db5aaaef633815a18d371fde4d1d;p=nextcloud-server.git 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 --- 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.