summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-11-27 09:21:17 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-11-27 09:21:17 +0100
commit70f4e7e10a87a912ccaf82693beb58ebe1e265a5 (patch)
treea75c4ac92dd022372d906252609ae3d4de33bb37 /apps/files/lib
parenta2046db6d011bef399f7952b2daf18734d6290ad (diff)
downloadnextcloud-server-70f4e7e10a87a912ccaf82693beb58ebe1e265a5.tar.gz
nextcloud-server-70f4e7e10a87a912ccaf82693beb58ebe1e265a5.zip
Catch file transfer error and stop transfer ownership command
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/Service/OwnershipTransferService.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php
index 0c5c25237b9..1683bbee9dc 100644
--- a/apps/files/lib/Service/OwnershipTransferService.php
+++ b/apps/files/lib/Service/OwnershipTransferService.php
@@ -215,6 +215,9 @@ class OwnershipTransferService {
return $shares;
}
+ /**
+ * @throws TransferOwnershipException
+ */
protected function transferFiles(string $sourceUid,
string $sourcePath,
string $finalTarget,
@@ -228,7 +231,9 @@ class OwnershipTransferService {
$view->mkdir($finalTarget);
$finalTarget = $finalTarget . '/' . basename($sourcePath);
}
- $view->rename($sourcePath, $finalTarget);
+ if ($view->rename($sourcePath, $finalTarget) === false) {
+ throw new TransferOwnershipException("Could not transfer files", 1);
+ }
if (!is_dir("$sourceUid/files")) {
// because the files folder is moved away we need to recreate it
$view->mkdir("$sourceUid/files");