diff --git a/src/changelog.ts b/src/changelog.ts index a540d85..e398ddc 100644 --- a/src/changelog.ts +++ b/src/changelog.ts @@ -178,8 +178,12 @@ export default class Changelog { await pMap( commitInfos, async (commitInfo: CommitInfo) => { - if (commitInfo.issueNumber) { - commitInfo.githubIssue = await this.github.getIssueData(this.config.repo, commitInfo.issueNumber); + try { + if (commitInfo.issueNumber) { + commitInfo.githubIssue = await this.github.getIssueData(this.config.repo, commitInfo.issueNumber); + } + } catch (err: any) { + console.error(`Error getting issue data: ${err.message}`); } progressBar.tick(); diff --git a/src/github-api.ts b/src/github-api.ts index 97429d5..31df497 100644 --- a/src/github-api.ts +++ b/src/github-api.ts @@ -68,7 +68,12 @@ export default class GithubAPI { if (res.ok) { return parsedResponse; } - throw new ConfigurationError(`Fetch error: ${res.statusText}.\n${JSON.stringify(parsedResponse)}`); + + if (res.status === 404) { + throw new ConfigurationError(`Not Found [${url}]`); + } + + throw new ConfigurationError(`Fetch error [${url}]: ${res.statusText}.\n${JSON.stringify(parsedResponse)}`); } private getAuthToken(): string {