From d5a12f124f1e299cdcd650b7b93b38b472de5210 Mon Sep 17 00:00:00 2001 From: Dhruv Puri Date: Sun, 31 May 2026 08:14:11 +0530 Subject: [PATCH 1/2] fix: handle GitHub API error response in ContributorProfile --- src/pages/ContributorProfile/ContributorProfile.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/ContributorProfile/ContributorProfile.tsx b/src/pages/ContributorProfile/ContributorProfile.tsx index ed1b714d..726e6815 100644 --- a/src/pages/ContributorProfile/ContributorProfile.tsx +++ b/src/pages/ContributorProfile/ContributorProfile.tsx @@ -27,6 +27,7 @@ export default function ContributorProfile() { try { const userRes = await fetch(`https://api.github.com/users/${username}`); const userData = await userRes.json(); + if (userData.message) throw new Error(userData.message); setProfile(userData); const prsRes = await fetch( From 9cca5c74344796ab2d8c017f3bc997105d94d435 Mon Sep 17 00:00:00 2001 From: Dhruv Puri Date: Sun, 31 May 2026 08:16:36 +0530 Subject: [PATCH 2/2] fix: use userRes.ok for reliable API error detection in ContributorProfile --- src/pages/ContributorProfile/ContributorProfile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ContributorProfile/ContributorProfile.tsx b/src/pages/ContributorProfile/ContributorProfile.tsx index 726e6815..4179d327 100644 --- a/src/pages/ContributorProfile/ContributorProfile.tsx +++ b/src/pages/ContributorProfile/ContributorProfile.tsx @@ -27,7 +27,7 @@ export default function ContributorProfile() { try { const userRes = await fetch(`https://api.github.com/users/${username}`); const userData = await userRes.json(); - if (userData.message) throw new Error(userData.message); + if (!userRes.ok) throw new Error(userData.message || `HTTP error: ${userRes.status}`); setProfile(userData); const prsRes = await fetch(