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'));
+ }
}
}
}