mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-12 11:39:57 +01:00
Propogate login error, fixes #89518
This commit is contained in:
@@ -274,9 +274,9 @@ export class AzureActiveDirectoryService {
|
||||
res.writeHead(302, { Location: '/' });
|
||||
res.end();
|
||||
} catch (err) {
|
||||
Logger.error(err.message);
|
||||
res.writeHead(302, { Location: `/?error=${encodeURIComponent(err && err.message || 'Unknown error')}` });
|
||||
res.end();
|
||||
throw new Error(err.message);
|
||||
}
|
||||
} catch (e) {
|
||||
Logger.error(e.message);
|
||||
@@ -285,6 +285,7 @@ export class AzureActiveDirectoryService {
|
||||
if (e.message === 'Error listening to server' || e.message === 'Closed' || e.message === 'Timeout waiting for port') {
|
||||
await this.loginWithoutLocalServer(scope);
|
||||
}
|
||||
throw new Error(e.message);
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
server.close();
|
||||
|
||||
@@ -22,7 +22,6 @@ export async function activate(_: vscode.ExtensionContext) {
|
||||
await loginService.login(scopes.sort().join(' '));
|
||||
return loginService.sessions[0]!;
|
||||
} catch (e) {
|
||||
vscode.window.showErrorMessage(`Logging in failed: ${e}`);
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -569,7 +569,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
try {
|
||||
await this.setActiveAccount(await this.authenticationService.login(this.userDataSyncStore!.authenticationProviderId, ['https://management.core.windows.net/.default', 'offline_access']));
|
||||
} catch (e) {
|
||||
this.notificationService.error(e);
|
||||
this.notificationService.error(localize('loginFailed', "Logging in failed: {0}", e));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user