Skip to content
Snippets Groups Projects
Unverified Commit 1dddf6ad authored by Julius Härtl's avatar Julius Härtl
Browse files

Properly catch exception from writing to stream when copying a file


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent 9780c4f7
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,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;
......@@ -200,8 +201,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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment