diff --git a/src/lib/github.ts b/src/lib/github.ts index d35c21bf..fc640cd6 100644 --- a/src/lib/github.ts +++ b/src/lib/github.ts @@ -1,6 +1,5 @@ import "server-only"; import { cache } from 'react'; -import { logger } from "@/lib/logger"; import type { UserProfile, @@ -682,15 +681,14 @@ export const fetchActivity = cache(async function fetchActivity( ) ); - // Suppress unhandled promise rejections for subsequent pages if we break early or throw - promises.forEach((p) => p.catch((e) => logger.error("Event fetch promise rejected:", e))); - - for (const p of promises) { - try { - const events = await p; + const results = await Promise.allSettled(promises); + for (const result of results) { + if (result.status === "fulfilled") { + const events = result.value; allEvents.push(...events); if (events.length < 100) break; - } catch (error) { + } else { + const error = result.reason; if ( error instanceof UserNotFoundError || error instanceof RateLimitError