Skip to content

Commit

Permalink
Update sync.d
Browse files Browse the repository at this point in the history
* Update logging output to be consistent with other file transfer failure actions
* As per default GUI notifications, failed uploads and downloads should be going to GUI for notifications if notification support has been compiled in
  • Loading branch information
abraunegg committed Sep 1, 2024
1 parent 36e4388 commit 65432dd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/sync.d
Original file line number Diff line number Diff line change
Expand Up @@ -2423,7 +2423,7 @@ class SyncEngine {
if ((localActualFreeSpace < freeSpaceReservation) || (jsonFileSize > localActualFreeSpace)) {
// localActualFreeSpace is less than freeSpaceReservation .. insufficient free space
// jsonFileSize is greater than localActualFreeSpace .. insufficient free space
addLogEntry("Downloading file: " ~ newItemPath ~ " ... failed!");
addLogEntry("Downloading file: " ~ newItemPath ~ " ... failed!", ["info", "notify"]);
addLogEntry("Insufficient local disk space to download file");
downloadFailed = true;
} else {
Expand Down Expand Up @@ -2624,7 +2624,7 @@ class SyncEngine {
}
} else {
// Output download failed
addLogEntry("Downloading file: " ~ newItemPath ~ " ... failed!");
addLogEntry("Downloading file: " ~ newItemPath ~ " ... failed!", ["info", "notify"]);
// Add the path to a list of items that failed to download
if (!canFind(fileDownloadFailures, newItemPath)) {
fileDownloadFailures ~= newItemPath; // Add newItemPath if it's not already present
Expand Down Expand Up @@ -5763,7 +5763,7 @@ class SyncEngine {
// Default operation if not 408,429,503,504 errors
// - 408,429,503,504 errors are handled as a retry within oneDriveApiInstance
// Display what the error is
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
displayOneDriveErrorMessage(exception.msg, thisFunctionName);

// OneDrive API Instance Cleanup - Shutdown API, free curl object and memory
Expand All @@ -5774,7 +5774,7 @@ class SyncEngine {

} catch (FileException e) {
// display the error message
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
displayFileSystemErrorMessage(e.msg, getFunctionName!({}));

// OneDrive API Instance Cleanup - Shutdown API, free curl object and memory
Expand Down Expand Up @@ -5807,12 +5807,12 @@ class SyncEngine {
// Default operation if not 408,429,503,504 errors
// - 408,429,503,504 errors are handled as a retry within oneDriveApiInstance
// Display what the error is
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
displayOneDriveErrorMessage(exception.msg, thisFunctionName);

} catch (FileException e) {
// display the error message
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
displayFileSystemErrorMessage(e.msg, getFunctionName!({}));
}

Expand Down Expand Up @@ -5847,7 +5847,7 @@ class SyncEngine {
uploadFailed = false;
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... done");
} else {
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
uploadFailed = true;
}
} catch (OneDriveException exception) {
Expand All @@ -5856,18 +5856,18 @@ class SyncEngine {
// Default operation if not 408,429,503,504 errors
// - 408,429,503,504 errors are handled as a retry within oneDriveApiInstance
// Display what the error is
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
displayOneDriveErrorMessage(exception.msg, thisFunctionName);

}
} else {
// No Upload URL or nextExpectedRanges or localPath .. not a valid JSON we can use
addLogEntry("Session data is missing required elements to perform a session upload.", ["verbose"]);
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
}
} else {
// Create session Upload URL failed
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed.");
addLogEntry("Uploading new file: " ~ fileToUpload ~ " ... failed!", ["info", "notify"]);
}

// OneDrive API Instance Cleanup - Shutdown API, free curl object and memory
Expand Down

0 comments on commit 65432dd

Please sign in to comment.