throw a proper error if rename fails in dav

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

View File

@ -138,7 +138,9 @@ abstract class Node implements \Sabre\DAV\INode {
$newPath = $parentPath . '/' . $newName;
$this->fileView->rename($this->path, $newPath);
if (!$this->fileView->rename($this->path, $newPath)) {
throw new \Sabre\DAV\Exception('Failed to rename '. $this->path . ' to ' . $newPath);
}
$this->path = $newPath;