mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-29 08:10:29 -04:00
Enable no-floating-promises for azurecore (#16946)
* Enable no-floating-promises for azurecore * few more * fix compile
This commit is contained in:
@@ -104,7 +104,7 @@ export abstract class AzureAuth implements vscode.Disposable {
|
||||
if (loginComplete) {
|
||||
loginComplete.reject(ex);
|
||||
} else {
|
||||
vscode.window.showErrorMessage(ex.getPrintableString());
|
||||
void vscode.window.showErrorMessage(ex.getPrintableString());
|
||||
}
|
||||
}
|
||||
Logger.error(ex);
|
||||
@@ -139,7 +139,7 @@ export abstract class AzureAuth implements vscode.Disposable {
|
||||
return await this.hydrateAccount(tokenResult, this.getTokenClaims(tokenResult.token));
|
||||
} catch (ex) {
|
||||
if (ex instanceof AzureAuthError) {
|
||||
vscode.window.showErrorMessage(ex.getPrintableString());
|
||||
void vscode.window.showErrorMessage(ex.getPrintableString());
|
||||
}
|
||||
Logger.error(ex);
|
||||
account.isStale = true;
|
||||
@@ -616,7 +616,7 @@ export abstract class AzureAuth implements vscode.Disposable {
|
||||
return this.deleteAccountCache(account);
|
||||
} catch (ex) {
|
||||
const msg = localize('azure.cacheErrrorRemove', "Error when removing your account from the cache.");
|
||||
vscode.window.showErrorMessage(msg);
|
||||
void vscode.window.showErrorMessage(msg);
|
||||
Logger.error('Error when removing tokens.', ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ export class AzureAccountProvider implements azdata.AccountProvider, vscode.Disp
|
||||
}
|
||||
|
||||
private async _getSecurityToken(account: AzureAccount, resource: azdata.AzureResource): Promise<MultiTenantTokenResponse | undefined> {
|
||||
vscode.window.showInformationMessage(localize('azure.deprecatedGetSecurityToken', "A call was made to azdata.accounts.getSecurityToken, this method is deprecated and will be removed in future releases. Please use getAccountSecurityToken instead."));
|
||||
void vscode.window.showInformationMessage(localize('azure.deprecatedGetSecurityToken', "A call was made to azdata.accounts.getSecurityToken, this method is deprecated and will be removed in future releases. Please use getAccountSecurityToken instead."));
|
||||
const azureAccount = account as AzureAccount;
|
||||
const response: MultiTenantTokenResponse = {};
|
||||
for (const tenant of azureAccount.properties.tenants) {
|
||||
@@ -147,7 +147,7 @@ export class AzureAccountProvider implements azdata.AccountProvider, vscode.Disp
|
||||
|
||||
if (this.authMappings.size === 0) {
|
||||
Logger.log('No auth method was enabled.');
|
||||
vscode.window.showErrorMessage(noAuthAvailable);
|
||||
void vscode.window.showErrorMessage(noAuthAvailable);
|
||||
return { canceled: true };
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ export class AzureAccountProvider implements azdata.AccountProvider, vscode.Disp
|
||||
|
||||
if (!pick) {
|
||||
Logger.log('No auth method was selected.');
|
||||
vscode.window.showErrorMessage(noAuthSelected);
|
||||
void vscode.window.showErrorMessage(noAuthSelected);
|
||||
return { canceled: true };
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ export class AzureAccountProviderService implements vscode.Disposable {
|
||||
AzureAccountProviderService.CommandClearTokenCache,
|
||||
() => { self._event.emit(AzureAccountProviderService.CommandClearTokenCache); }
|
||||
));
|
||||
this._event.on(AzureAccountProviderService.CommandClearTokenCache, () => { self.onClearTokenCache(); });
|
||||
this._event.on(AzureAccountProviderService.CommandClearTokenCache, () => { void self.onClearTokenCache(); });
|
||||
|
||||
// 1) Get a credential provider
|
||||
// 2a) Store the credential provider for use later
|
||||
@@ -98,11 +98,11 @@ export class AzureAccountProviderService implements vscode.Disposable {
|
||||
.then(
|
||||
() => {
|
||||
let message = localize('clearTokenCacheSuccess', "Token cache successfully cleared");
|
||||
vscode.window.showInformationMessage(`${loc.extensionName}: ${message}`);
|
||||
void vscode.window.showInformationMessage(`${loc.extensionName}: ${message}`);
|
||||
},
|
||||
err => {
|
||||
let message = localize('clearTokenCacheFailure', "Failed to clear token cache");
|
||||
vscode.window.showErrorMessage(`${loc.extensionName}: ${message}: ${err}`);
|
||||
void vscode.window.showErrorMessage(`${loc.extensionName}: ${message}: ${err}`);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user