Skip to content

Commit ac34b98

Browse files
committed
add logs for file size determination
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent cd7b554 commit ac34b98

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

app/src/main/java/com/owncloud/android/operations/UploadFileOperation.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,16 @@ private RemoteOperationResult normalUpload(OwnCloudClient client) {
10971097
long size;
10981098
try {
10991099
size = channel.size();
1100-
} catch (IOException e) {
1101-
size = Files.size(filePath);
1100+
} catch (Exception e) {
1101+
Log_OC.e(TAG, "failed to determine file size from channel: ", e);
1102+
1103+
try {
1104+
size = Files.size(filePath);
1105+
} catch (Exception exception) {
1106+
Log_OC.e(TAG, "failed to determine file size from nio.File: ", exception);
1107+
result = new RemoteOperationResult<>(ResultCode.FILE_NOT_FOUND);
1108+
return result;
1109+
}
11021110
}
11031111
updateSize(size);
11041112

0 commit comments

Comments
 (0)