mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 01:25:37 -05:00
Show error to user (#9014)
* Show error to user * Update the errors * change message
This commit is contained in:
@@ -79,7 +79,9 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
|
||||
context.cache.add([response], (err, result) => {
|
||||
if (err || !result) {
|
||||
console.log(`Unexpected error adding token to cache ${err}`);
|
||||
const msg = localize('azure.tokenCacheFail', "Unexpected error adding token to cache: {0}", err.message);
|
||||
vscode.window.showErrorMessage(msg);
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -287,7 +289,9 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
try {
|
||||
graphToken = await this.getToken(userId, value.tenantId, this.metadata.settings.graphResource.id);
|
||||
} catch (ex) {
|
||||
console.log(`Your authentication to the tenant ${value.tenantId} failed: ${ex}`);
|
||||
const msg = localize('azure.authFail', "Your authentication to the tenant {0} failed: {1}", value.tenantId, ex);
|
||||
vscode.window.showErrorMessage(msg);
|
||||
console.log(msg);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -308,7 +312,9 @@ export class AzureAccountProvider implements azdata.AccountProvider {
|
||||
|
||||
tenants = tenants.filter(t => t !== undefined);
|
||||
if (tenants.length === 0) {
|
||||
throw new Error(localize('azure.noTenants', "No azure tenants found. Failing..."));
|
||||
const msg = localize('azure.noTenants', "Failed to add account. No Azure tenants.");
|
||||
vscode.window.showErrorMessage(msg);
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
||||
if (homeTenant) {
|
||||
|
||||
Reference in New Issue
Block a user