Skip to content

Commit

Permalink
add additional log statement
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt committed Apr 27, 2022
1 parent f1b6244 commit 842a41c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions extensions/github-authentication/src/githubServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 842a41c

Please sign in to comment.