From 19a3ac67a719e3e71fabdffe8921dbbd9ffc22fc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 14 Mar 2019 15:40:21 +0100 Subject: [PATCH] throw a proper error if rename fails in dav Signed-off-by: Robin Appelman --- apps/dav/lib/Connector/Sabre/Node.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index 38d0ff57fb2b6..92f1f98acc5fe 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -136,7 +136,9 @@ public function setName($name) { $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;