additional logging when mkdir fails for object storage

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2022-05-09 16:56:40 +02:00
parent a1b7f132c8
commit c6be96d04f
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -97,6 +97,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
public function mkdir($path) {
$path = $this->normalizePath($path);
if ($this->file_exists($path)) {
$this->logger->warning("Tried to create an object store folder that already exists: $path");
return false;
}
@ -120,10 +121,12 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
if ($parentType === false) {
if (!$this->mkdir($parent)) {
// something went wrong
$this->logger->warning("Parent folder ($parent) doesn't exist and couldn't be created");
return false;
}
} elseif ($parentType === 'file') {
// parent is a file
$this->logger->warning("Parent ($parent) is a file");
return false;
}
// finally create the new dir