Handle exception error when query for tenant id

* Handle exception error when query for tenant id
This commit is contained in:
abraunegg 2020-12-12 08:43:55 +11:00
parent 2a93b4ed88
commit 0e886ac27e

View file

@ -6139,7 +6139,17 @@ final class SyncEngine
// Get My Tenent Details
string myTenantID;
JSONValue tenantDetailsResponse = onedrive.getTenantID();
JSONValue tenantDetailsResponse;
try {
tenantDetailsResponse = onedrive.getTenantID();
} catch (OneDriveException e) {
// display what the error is
displayOneDriveErrorMessage(e.msg, getFunctionName!({}));
log.error("\nERROR: Authorisation scopes potentially invalid, use --logout to authorize the client again.\n");
return;
}
if (tenantDetailsResponse.type() == JSONType.object) {
foreach (searchResult; tenantDetailsResponse["value"].array) {
myTenantID = searchResult["id"].str;