Do not show warning messages for stale accounts (#21621)

This commit is contained in:
Cheena Malhotra
2023-01-24 16:21:43 -08:00
committed by GitHub
parent ef240a9a63
commit 84fd46c901

View File

@@ -50,12 +50,14 @@ export class AzureResourceSubscriptionService implements IAzureResourceSubscript
void vscode.window.showWarningMessage(errorMsg);
}
} catch (error) {
if (!account.isStale) {
const errorMsg = localize('azure.resource.tenantSubscriptionsError', "Failed to get subscriptions for account {0} (tenant '{1}'). {2}", account.displayInfo.displayName, tenantId, AzureResourceErrorMessageUtil.getErrorMessage(error));
Logger.error(`Failed to get subscriptions for account ${account.displayInfo.displayName} (tenant '${tenantId}'). ${AzureResourceErrorMessageUtil.getErrorMessage(error)}`);
errors.push(error);
void vscode.window.showWarningMessage(errorMsg);
}
}
}
if (!gotSubscriptions) {
throw new AzureSubscriptionError(account.key.accountId, errors);
}