Skip to content

Commit

Permalink
improve error handeling for GithubCommitActivity
Browse files Browse the repository at this point in the history
The author filter error handling removed was redundent as it would never execute, there is no way to seperate branch not found from repo not found.
  • Loading branch information
jNullj committed Jun 14, 2023
1 parent 6703fe6 commit 9e358c8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions services/github/github-commit-activity.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default class GitHubCommitActivity extends GithubAuthV4Service {
since,
},
},
errorMessages: errorMessagesFor('repo not found'),
errorMessages: errorMessagesFor('repo or branch not found'),
})
}

Expand All @@ -152,11 +152,7 @@ export default class GitHubCommitActivity extends GithubAuthV4Service {
return repo.history.totalCount
}

static transformAuthorFilter({ res, buffer }) {
if (buffer.message === 'Not Found') {
throw new InvalidResponse({ prettyMessage: 'invalid branch' })
}

static transformAuthorFilter({ res }) {
const parsed = parseLinkHeader(res.headers.link)

if (!parsed) {
Expand Down

0 comments on commit 9e358c8

Please sign in to comment.