Merge pull request #22556 from nextcloud/bugfix/noid/cleanup-part-file

Do not keep the part file if the forbidden exception has no retry set
This commit is contained in:
blizzz 2020-09-03 13:01:08 +02:00 committed by GitHub
commit d20a11f171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -288,6 +288,9 @@ class File extends Node implements IFile {
throw new Exception('Could not rename part file to final file');
}
} catch (ForbiddenException $ex) {
if (!$ex->getRetry()) {
$partStorage->unlink($internalPartPath);
}
throw new DAVForbiddenException($ex->getMessage(), $ex->getRetry());
} catch (\Exception $e) {
$partStorage->unlink($internalPartPath);