Skip to content

fix: show friendly error message instead of raw JSON on rate limit#940

Merged
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
meetparmar392005:fix/friendly-error-message
May 29, 2026
Merged

fix: show friendly error message instead of raw JSON on rate limit#940
JhaSourav07 merged 2 commits into
JhaSourav07:mainfrom
meetparmar392005:fix/friendly-error-message

Conversation

@meetparmar392005
Copy link
Copy Markdown
Contributor

Fixes #936

Description

When the API rate limit was hit, the homepage displayed raw JSON
{"error":"Too many requests"} directly to the user. This fix handles
the error response properly on the frontend and shows a friendly message instead.

Changes Made

  • Added errorMessage state to track API error responses
  • Updated fetch logic to check res.ok and handle 429 status specifically
  • Display friendly message: "Too many requests. Please wait a moment and try again. ⏳"
  • Generic fallback message for other errors: "Something went wrong. Please try again."
  • Error resets when username changes

Pillar

🐛 Bug Fix — Error handling & UX

Checklist

  • I have read CONTRIBUTING.md
  • npm run lint passes locally
  • npm run test passes locally ✅
  • No SVG output changes

Copilot AI review requested due to automatic review settings May 28, 2026 11:54
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 28, 2026

@meetparmar392005 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

👋 Hey @meetparmar392005, welcome to CommitPulse! 🎉

Thanks for opening your first pull request — this is a big deal and we appreciate the effort!

While you wait for a review, please double-check:

  • ✅ You've read the CONTRIBUTING.md checklist
  • npm run lint, npm run format, and npm run test all pass locally
  • ✅ Your PR has a visual preview if it touches any SVG output
  • 💬 You've joined our Discord for faster PR feedback

A maintainer will review your PR shortly. Hang tight! 🚀

Copy link
Copy Markdown
Collaborator

@Aamod007 Aamod007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meetparmar392005 replaces raw {"error":"Too many requests"} JSON with a friendly message. Only note: the implementation also catches non-429 errors with a generic message, which replaces the branded error SVGs the server normally returns for 500s.

@Aamod007
Copy link
Copy Markdown
Collaborator

@meetparmar392005 make pr according to guideline

@github-actions github-actions Bot added type:bug Something isn't working as expected needs-rebase This PR has merge conflicts and needs a rebase. labels May 28, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

13 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@meetparmar392005 meetparmar392005 force-pushed the fix/friendly-error-message branch from b89bf64 to c5eea03 Compare May 29, 2026 18:04
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label May 29, 2026
@github-actions
Copy link
Copy Markdown

🚨 Hey @meetparmar392005, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

Please fix the issues before this can be reviewed. Here's how:

1. Run checks locally before pushing:

npm run format:check   # Check Prettier formatting
npm run lint           # Run ESLint
npm run typecheck      # TypeScript type check
npm run test           # Run unit tests (Vitest)
npm run build          # Verify production build passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@github-actions github-actions Bot removed the needs-rebase This PR has merge conflicts and needs a rebase. label May 29, 2026
@meetparmar392005 meetparmar392005 force-pushed the fix/friendly-error-message branch from c5eea03 to 58fb782 Compare May 29, 2026 18:46
@meetparmar392005 meetparmar392005 force-pushed the fix/friendly-error-message branch 2 times, most recently from 1d8e8f3 to d226934 Compare May 29, 2026 19:38
@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 29, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

6 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot removed the needs-rebase This PR has merge conflicts and needs a rebase. label May 29, 2026
@meetparmar392005 meetparmar392005 force-pushed the fix/friendly-error-message branch from 4036dfa to a786bba Compare May 29, 2026 19:55
@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 29, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label May 29, 2026
@meetparmar392005 meetparmar392005 force-pushed the fix/friendly-error-message branch from a786bba to a84e19b Compare May 29, 2026 19:55
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

2 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

Please pull the latest changes and resolve the conflicts so we can review it!

git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot removed the needs-rebase This PR has merge conflicts and needs a rebase. label May 29, 2026
@meetparmar392005 meetparmar392005 requested a review from Aamod007 May 29, 2026 20:03
@JhaSourav07 JhaSourav07 merged commit de5f4fd into JhaSourav07:main May 29, 2026
4 of 5 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Congratulations @meetparmar392005! Your PR has been successfully merged. 🚀

Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.

⚠️ Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.

Keep building! 💻✨

@JhaSourav07 JhaSourav07 added GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:exceptional Outstanding contribution with exceptional implementation quality, testing. gssoc:approved PR has been reviewed and accepted for valid contribution points labels May 29, 2026
@github-actions github-actions Bot added this to the GSSoC 2026 milestone May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved PR has been reviewed and accepted for valid contribution points GSSoC 2026 level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:exceptional Outstanding contribution with exceptional implementation quality, testing. type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Raw JSON error displayed to user instead of friendly message

3 participants