Fix not all files being downloaded due to query failure & false DB update (#564)

* If query for file details or file object generates an error, we return, but we also need to flag that downloadFailed = true so that item is not added to the database which may cause validation issues leading to thinking that the file was downloaded but then deleted
This commit is contained in:
abraunegg 2019-07-03 18:33:51 +10:00 committed by GitHub
parent 366f7a33d1
commit 1d02b3cb7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1111,10 +1111,12 @@ final class SyncEngine
} catch (OneDriveException e) {
if (e.httpStatusCode >= 500) {
// OneDrive returned a 'HTTP 5xx Server Side Error' - gracefully handling error - error message already logged
downloadFailed = true;
return;
} else {
// Default operation if not a 500 error
log.error("ERROR: Query of OneDrive for file details failed");
downloadFailed = true;
return;
}
}
@ -1132,6 +1134,7 @@ final class SyncEngine
// Issue #550 handling
log.vdebug("ERROR: onedrive.getFileDetails call returned a OneDriveException error");
// We want to return, cant download
downloadFailed = true;
return;
}
@ -1147,6 +1150,7 @@ final class SyncEngine
// Issue #540 handling
log.vdebug("ERROR: onedrive.getFileDetails call returned a OneDriveException error");
// We want to return, cant download
downloadFailed = true;
return;
}