add additional log statement

This commit is contained in:
Tyler Leonhardt 2022-04-27 15:38:49 -07:00
parent f1b6244889
commit 842a41c8ab
No known key found for this signature in database
GPG key ID: D9BFA0BA8AD9F6F7

View file

@ -90,9 +90,14 @@ async function getUserInfo(token: string, serverUri: vscode.Uri, logger: Log): P
}
if (result.ok) {
const json = await result.json();
logger.info('Got account info!');
return { id: json.id, accountName: json.login };
try {
const json = await result.json();
logger.info('Got account info!');
return { id: json.id, accountName: json.login };
} catch (e) {
logger.error(`Unexpected error parsing response from GitHub: ${e.message ?? e}`);
throw e;
}
} else {
// either display the response message or the http status text
let errorMessage = result.statusText;