Skip to content

Commit 8bcd058

Browse files
authored
More login logging (#6787)
1 parent 6f71829 commit 8bcd058

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/github/credentials.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,23 @@ export class CredentialStore extends Disposable {
180180
github = await this.createHub(session.accessToken, authProviderId);
181181
} catch (e) {
182182
if ((e.message === 'Bad credentials') && !getAuthSessionOptions.forceNewSession) {
183+
Logger.debug(`Creating hub failed ${e.message}`, CredentialStore.ID);
183184
getAuthSessionOptions.forceNewSession = true;
184185
getAuthSessionOptions.silent = false;
185186
return this.initialize(authProviderId, getAuthSessionOptions, scopes, requireScopes);
187+
} else {
188+
// console.log because we need to see if we can learn more from the error object.
189+
console.log(e);
190+
Logger.error(`Creating hub failed ${e.message}`, CredentialStore.ID);
191+
vscode.window.showErrorMessage(vscode.l10n.t('Unable to sign in with the provided credentials'));
186192
}
187193
}
188194
if (!isEnterprise(authProviderId)) {
195+
Logger.debug('Setting hub and scopes', CredentialStore.ID);
189196
this._githubAPI = github;
190197
this._scopes = usedScopes;
191198
} else {
199+
Logger.debug('Setting enterprise hub and scopes', CredentialStore.ID);
192200
this._githubEnterpriseAPI = github;
193201
this._scopesEnterprise = usedScopes;
194202
}

0 commit comments

Comments
 (0)