Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
salemxd committed Apr 29, 2024
1 parent aaae805 commit 1a00c06
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/identitiesInRepo/identitiesInRepoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,17 @@ export class IdentitiesInRepoService {
core.exportVariable('numberOfCodeWriters', numberOfWriters);
core.exportVariable('numberOfCodeReaders', numberOfReaders);
} catch (error) {
core.warning('Failed to fetch identities for repo');
core.warning(error.message);
core.info('Failed to fetch identities for repo');
if (error.status === 401 || error.status === 403) {
// Removes link to REST API endpoint
const errorMessage: string = error.message.split('.')[0];
core.warning(errorMessage, {
title: 'Failed to fetch identities for repo',
});
}
else {
core.info(error.message);
}
}
console.log();
}
Expand Down

0 comments on commit 1a00c06

Please sign in to comment.