Skip to content

Commit

Permalink
fix(github): emit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Oct 18, 2022
1 parent c09ec8c commit 0319745
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/github.ts
Expand Up @@ -38,6 +38,8 @@ export async function fetchGitHubSponsors(token: string, login: string, type: st

if (data.errors?.[0]?.type === 'INSUFFICIENT_SCOPES')
throw new Error('Token is missing the `read:user` and/or `read:org` scopes')
else if (data.errors.length)
throw new Error(`GitHub API error:\n${JSON.stringify(data.errors, null, 2)}`)

sponsors.push(
...(data.data[type].sponsorshipsAsMaintainer.nodes || []),
Expand Down

0 comments on commit 0319745

Please sign in to comment.