mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 10:40:40 -04:00
Properly catch exception from writing to stream when copying a file
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
c8381c5d17
commit
f5dec3702b
1 changed files with 9 additions and 2 deletions
|
|
@ -51,6 +51,7 @@ use OCP\Encryption\Exceptions\GenericEncryptionException;
|
|||
use OCP\Files\EntityTooLargeException;
|
||||
use OCP\Files\FileInfo;
|
||||
use OCP\Files\ForbiddenException;
|
||||
use OCP\Files\GenericFileException;
|
||||
use OCP\Files\InvalidContentException;
|
||||
use OCP\Files\InvalidPathException;
|
||||
use OCP\Files\LockNotAcquiredException;
|
||||
|
|
@ -199,8 +200,14 @@ class File extends Node implements IFile {
|
|||
$isEOF = feof($stream);
|
||||
});
|
||||
|
||||
$count = $partStorage->writeStream($internalPartPath, $wrappedData);
|
||||
$result = $count > 0;
|
||||
$result = true;
|
||||
$count = -1;
|
||||
try {
|
||||
$count = $partStorage->writeStream($internalPartPath, $wrappedData);
|
||||
} catch (GenericFileException $e) {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
|
||||
if ($result === false) {
|
||||
$result = $isEOF;
|
||||
|
|
|
|||
Loading…
Reference in a new issue