Skip to content

Commit

Permalink
fix: correct 404 detection
Browse files Browse the repository at this point in the history
It seems this started failing some 2 weeks ago due to one of the octokit deps changing
  • Loading branch information
dominykas committed Jun 28, 2021
1 parent b0fb895 commit 640f93b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports.getPackageJson = async function getPackageJson (owner, repo) {
})
return (JSON.parse(resp.repository.object.text))
} catch (err) {
if (err.errors && err.errors[0].type === 'NOT_FOUND') {
if (err.status === 404) {
throw Error(`Could not find GitHub repository at https://www.github.com/${owner}/${repo}`)
} else {
throw err
Expand Down

0 comments on commit 640f93b

Please sign in to comment.