Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function graphqlRequest<T>(
const resetSec = parseInt(response.headers.get('x-ratelimit-reset') ?? '0', 10)
const resetMs = resetSec ? resetSec * 1000 + 5_000 : Date.now() + 65_000

if (response.status === 401) throw new FetchError('AUTH', '401 Unauthorized')
if (response.status === 401) throw new FetchError('TRANSIENT', '401 Unauthorized')
if (response.status === 403) {
const body = await response.text()
if (body.toLowerCase().includes('rate limit'))
Expand Down
3 changes: 2 additions & 1 deletion services/apps/packages_worker/src/enricher/fetchLightRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ export async function fetchLightRepo(
const resetSec = parseInt(response.headers.get('x-ratelimit-reset') ?? '0', 10)
const resetMs = resetSec ? resetSec * 1000 + 5_000 : Date.now() + 65_000

if (response.status === 401) throw new FetchError('AUTH', `401 Unauthorized for ${url}`)
// 401 is requester/platform-side (bad token, GitHub auth incident) — never a repo signal
if (response.status === 401) throw new FetchError('TRANSIENT', `401 Unauthorized for ${url}`)

if (response.status === 403) {
const body = await response.text()
Expand Down
Loading