Skip to content

Commit d5a12f1

Browse files
committed
fix: handle GitHub API error response in ContributorProfile
1 parent e7b8fc8 commit d5a12f1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/pages/ContributorProfile/ContributorProfile.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default function ContributorProfile() {
2727
try {
2828
const userRes = await fetch(`https://api.github.com/users/${username}`);
2929
const userData = await userRes.json();
30+
if (userData.message) throw new Error(userData.message);
3031
setProfile(userData);
3132

3233
const prsRes = await fetch(

0 commit comments

Comments
 (0)