Переглянути джерело

throw a proper error if rename fails in dav

Signed-off-by: Robin Appelman <robin@icewind.nl>
Robin Appelman 5 роки тому
батько
коміт
19a3ac67a7
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      apps/dav/lib/Connector/Sabre/Node.php

+ 3 - 1
apps/dav/lib/Connector/Sabre/Node.php

@@ -136,7 +136,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;