log more information about insufficient storage in dav plugin

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2018-04-13 11:52:01 +02:00 committed by Backportbot
parent 88455103fd
commit 6252f07fbc
1 changed files with 2 additions and 2 deletions

View File

@ -169,11 +169,11 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
$path = rtrim($parentPath, '/') . '/' . $info['name'];
}
$freeSpace = $this->getFreeSpace($path);
if ($freeSpace !== FileInfo::SPACE_UNKNOWN && $freeSpace !== FileInfo::SPACE_UNLIMITED && $length > $freeSpace) {
if ($freeSpace >= 0 && $length > $freeSpace) {
if (isset($chunkHandler)) {
$chunkHandler->cleanup();
}
throw new InsufficientStorage();
throw new InsufficientStorage("Insufficient space in $path, $length required, $freeSpace available");
}
}
return true;