mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Azure auth - throw original error message (#23613)
This commit is contained in:
@@ -150,8 +150,9 @@ export class AzureAuthCodeGrant extends AzureAuth {
|
||||
|
||||
return authCodeRequest;
|
||||
} catch (e) {
|
||||
Logger.error('MSAL: Error requesting auth code', e);
|
||||
throw new AzureAuthError('error', 'Error requesting auth code', e);
|
||||
let errorMessage = localize('azureAuthCodeGrant.getAuthCodeUrlError', 'An error occurred in MSAL library when requesting auth code URL. For more detailed information on error, please check \'Azure Accounts\' output pane. \n\n');
|
||||
Logger.error(errorMessage);
|
||||
throw new AzureAuthError(errorMessage + e.message, e.message, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,18 +249,16 @@ export class AzureAuthCodeGrant extends AzureAuth {
|
||||
};
|
||||
let authCodeUrl = await this.clientApplication.getAuthCodeUrl(authUrlRequest);
|
||||
|
||||
|
||||
await vscode.env.openExternal(vscode.Uri.parse(`http://localhost:${serverPort}/signin?nonce=${encodeURIComponent(this.pkceCodes.nonce)}`));
|
||||
const authCode = await this.addServerListeners(server, this.pkceCodes.nonce, authCodeUrl, authCompletePromise);
|
||||
|
||||
authCodeRequest.code = authCode;
|
||||
|
||||
return authCodeRequest;
|
||||
}
|
||||
|
||||
catch (e) {
|
||||
Logger.error('MSAL: Error requesting auth code', e);
|
||||
throw new AzureAuthError('error', 'Error requesting auth code', e);
|
||||
let errorMessage = localize('azureAuthCodeGrant.getAuthCodeUrlError', 'An error occurred in MSAL library when requesting auth code URL. For more detailed information on error, please check \'Azure Accounts\' output pane. \n\n');
|
||||
Logger.error(errorMessage);
|
||||
throw new AzureAuthError(errorMessage + e.message, e.message, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user