log failures for local fsize

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2019-03-14 18:13:00 +01:00
parent 762a8bb3d9
commit ae2cf51056
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 7 additions and 1 deletions

View File

@ -165,7 +165,13 @@ class Local extends \OC\Files\Storage\Common {
$helper = new \OC\LargeFileHelper;
return $helper->getFileSize($fullPath);
}
return filesize($fullPath);
$result = filesize($fullPath);
if ($result === false) {
$exists = file_exists($fullPath);
$message = $exists ? "Failed to get size for $path even though file exists" : "Failed to get size for $path, file not found";
\OC::$server->getLogger()->logException(new \Exception($message), ['level' => ILogger::WARN]);
}
return $result;
}
public function isReadable($path) {