Skip to content

Commit

Permalink
fix: handle errors when loading commits
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Jul 17, 2023
1 parent 6c5bf58 commit 72713aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/find-repository-file-endorsements.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ export async function findRepositoryFileEndorsements(

repoLogger.info({ owner, repo, path, since }, `Loading commits`);

const commits = await getAllCommitsForFile(octokit, owner, repo, path, since);
let commits;
try {
commits = await getAllCommitsForFile(octokit, owner, repo, path, since);
} catch (error) {
repoLogger.error({ error }, `Error loading commits`);
return;
}

// Commits can be empty if we pass `since`
if (commits.length === 0) return;
Expand Down

0 comments on commit 72713aa

Please sign in to comment.