Fix Bug #3245: Handle API 403 response when file fragment upload fails (#3246)

* Catch a 403 Access denied response and handle differently to other errors where a re-try is possible
This commit is contained in:
abraunegg 2025-04-30 05:53:35 +10:00 committed by GitHub
commit 715cf3e9e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8968,6 +8968,14 @@ class SyncEngine {
// Insert a new line as well, so that the below error is inserted on the console in the right location
if (verboseLogging) {addLogEntry("Fragment upload failed - received an exception response from OneDrive API", ["verbose"]);}
// HTTP request returned status code 403 (Forbidden) - Access denied
// - There is no point here attempting a re-try
if (exception.httpStatusCode == 403) {
displayOneDriveErrorMessage(exception.msg, thisFunctionName);
uploadResponse = null;
return uploadResponse;
}
// display what the error is
if (exception.httpStatusCode != 404) {
displayOneDriveErrorMessage(exception.msg, thisFunctionName);