]> source.dussan.org Git - nextcloud-server.git/commitdiff
catch and log exception in OC_Helper::cleanTmp()
authorThomas Müller <thomas.mueller@tmit.eu>
Fri, 26 Sep 2014 07:17:47 +0000 (09:17 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Fri, 26 Sep 2014 09:36:53 +0000 (11:36 +0200)
lib/private/helper.php

index 1297d356d0948af36069b4579e2e9ddc1a66d80c..ea91cc5751643f688a8d05f41bd0e01fd987d863 100644 (file)
@@ -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'));
+                                       }
                                }
                        }
                }