diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-09-26 14:31:31 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-09-26 14:31:31 +0200 |
commit | 53f6d74938647de6921da47d28bd06b30a708cc5 (patch) | |
tree | fa492b9aa0e08f83e8405833687b84ff1746dc57 | |
parent | e5a111b80e20b188efe782c8245d2379596f893c (diff) | |
parent | 4c08215e665e30249af51e688de9d0b3bbb68909 (diff) | |
download | nextcloud-server-53f6d74938647de6921da47d28bd06b30a708cc5.tar.gz nextcloud-server-53f6d74938647de6921da47d28bd06b30a708cc5.zip |
Merge pull request #11311 from owncloud/fixing-unhandled-exception-cleanTmp-master
catch and log exception in OC_Helper::cleanTmp()
-rw-r--r-- | lib/private/helper.php | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php index 1297d356d09..ea91cc57516 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -644,15 +644,33 @@ class OC_Helper { if (file_exists($leftoversFile)) { $leftovers = file($leftoversFile); foreach ($leftovers as $file) { - self::rmdirr($file); + try { + self::rmdirr($file); + } catch (UnexpectedValueException $ex) { + // not really much we can do here anymore + if (!is_null(\OC::$server)) { + $message = $ex->getMessage(); + \OC::$server->getLogger()->error("Error deleting file/folder: $file - Reason: $message", + array('app' => 'core')); + } + } } unlink($leftoversFile); } foreach (self::$tmpFiles as $file) { if (file_exists($file)) { - if (!self::rmdirr($file)) { - file_put_contents($leftoversFile, $file . "\n", FILE_APPEND); + try { + if (!self::rmdirr($file)) { + file_put_contents($leftoversFile, $file . "\n", FILE_APPEND); + } + } catch (UnexpectedValueException $ex) { + // not really much we can do here anymore + if (!is_null(\OC::$server)) { + $message = $ex->getMessage(); + \OC::$server->getLogger()->error("Error deleting file/folder: $file - Reason: $message", + array('app' => 'core')); + } } } } |