From 1d02b3cb7a3d981306bfbbbe8927643b6ebf1b2d Mon Sep 17 00:00:00 2001 From: abraunegg Date: Wed, 3 Jul 2019 18:33:51 +1000 Subject: [PATCH] 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 --- src/sync.d | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sync.d b/src/sync.d index 2620d842..04460ca3 100644 --- a/src/sync.d +++ b/src/sync.d @@ -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; }