Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,15 @@ async function fetchContributionsUncached(

if (!res.ok) {
throwIfRateLimited(res);
if (res.status === 401) throw new Error('GitHub PAT is invalid or missing');

const bodyText = await res.text().catch(() => '');

if (res.status === 401) {
throw new Error(`GitHub PAT is invalid or missing. Response: ${bodyText || '<empty>'}`);
}

throw new Error(
`GitHub GraphQL API returned status ${res.status} after ${MAX_RETRIES} retries`
`GitHub GraphQL API returned status ${res.status} after ${MAX_RETRIES} retries. Response: ${bodyText || '<empty>'}`
);
}

Expand Down
Loading