Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Nov 22, 2023
1 parent 1d59f0b commit 8fbf988
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions components/dashboard/src/service/json-rpc-scm-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ export class JsonRpcScmClient implements PromiseClient<typeof SCMService> {
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "host is required");
}
const response = new SearchSCMTokensResponse();
try {
const token = await getGitpodService().server.getToken({ host });
if (token) {
response.tokens.push(converter.toSCMToken(token));
}
} catch (error) {
throw new ApplicationError(ErrorCodes.NOT_FOUND, "token not found");
const token = await getGitpodService().server.getToken({ host });
if (token) {
response.tokens.push(converter.toSCMToken(token));
}
return response;
}
Expand All @@ -53,7 +49,7 @@ export class JsonRpcScmClient implements PromiseClient<typeof SCMService> {
});
return new GuessTokenScopesResponse({
message: response.message,
scopes: response.scopes,
scopes: response.scopes || [],
});
}

Expand Down

0 comments on commit 8fbf988

Please sign in to comment.