Better handle out-of-space message (#907)

* Better handle out-of-space message when OneDrive is out of space
This commit is contained in:
abraunegg 2020-05-05 15:04:59 +10:00 committed by GitHub
parent 4a4d44667e
commit eda3d3c4bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -365,8 +365,20 @@ final class SyncEngine
// In some cases OneDrive Business configurations 'restrict' quota details thus is empty / blank / negative value / zero
if (remainingFreeSpace <= 0) {
// quota details not available
log.error("ERROR: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.");
// free space is <= 0 .. why ?
if ("remaining" in oneDriveDetails["quota"]){
// json response contained a 'remaining' value
log.error("ERROR: OneDrive account currently has zero space available. Please free up some space online.");
} else {
// json response was missing a 'remaining' value
if (accountType == "personal"){
log.error("ERROR: OneDrive quota information is missing. Potentially your OneDrive account currently has zero space available. Please free up some space online.");
} else {
// quota details not available
log.error("ERROR: OneDrive quota information is being restricted. Please fix by speaking to your OneDrive / Office 365 Administrator.");
}
}
// flag to not perform quota checks
log.error("ERROR: Flagging to disable upload space checks - this MAY have undesirable results if a file cannot be uploaded due to out of space.");
quotaAvailable = false;
}