Skip to content

Commit

Permalink
scrape.js: Catch exception for GitHub GraphQL
Browse files Browse the repository at this point in the history
Fixes #163
  • Loading branch information
li-boxuan committed Oct 27, 2018
1 parent 3cdc304 commit 2ea74bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ async function fetchLeaders(id) {
let repositoryInfo = {}
async function fetchRepositoryInfo(org) {
if (repositoryInfo[org]) return repositoryInfo[org]
const { data, errors } = await client.query(GITHUB_REPO_INFO_QUERY, { org })
let data, errors
try {
;({ data, errors } = await client.query(GITHUB_REPO_INFO_QUERY, { org }))
} catch (error) {
console.warn(`GitHub query for org ${org} fails, error: ${error}`)
}

if (data && data.organization) {
const info = data.organization.repositories.nodes.map(node => ({
Expand Down

0 comments on commit 2ea74bc

Please sign in to comment.