Do not keep the part file if the forbidden exception has retry set to false

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-09-03 11:00:24 +02:00 committed by backportbot[bot]
parent 45dcdc3948
commit f4dfb96d8d
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);