Skip to content

Improve user-friendly error handling for tracker search requests#298

Merged
mehul-m-prajapati merged 1 commit into
GitMetricsLab:mainfrom
jagriti-aswal:fix-tracker-error-handling
May 17, 2026
Merged

Improve user-friendly error handling for tracker search requests#298
mehul-m-prajapati merged 1 commit into
GitMetricsLab:mainfrom
jagriti-aswal:fix-tracker-error-handling

Conversation

@jagriti-aswal
Copy link
Copy Markdown
Contributor

@jagriti-aswal jagriti-aswal commented May 17, 2026

Related Issue

Closes #297


Description

Improved error handling for invalid GitHub tracker search requests.

Changes made:

  • Replaced raw GitHub API error responses with cleaner user-friendly messages
  • Added better handling for:
    • invalid usernames
    • permission issues
    • failed API requests
  • Added fallback error messaging for unexpected errors

How Has This Been Tested?

  • Tested locally using invalid GitHub usernames
  • Tested with invalid/expired PAT tokens
  • Verified improved UI error messages appear correctly

Screenshots (if applicable)

Updated Error UI

Screenshot 2026-05-17 192600

Added in issue discussion.


Type Of Change

  • Bug fix
  • New feature
  • Code style update

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error handling for GitHub data retrieval with improved error messages for invalid usernames, insufficient permissions, and validation failures.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 17, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 1dd334c
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a09c96c90bd660008f58ad5
😎 Deploy Preview https://deploy-preview-298--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR improves error handling in the useGitHubData hook by adding a dedicated branch for GitHub API validation errors. When the API returns a validation-failed response, the hook now maps it to a user-friendly message instead of exposing the raw API error text to users.

Changes

GitHub Error Message Clarity

Layer / File(s) Summary
Validation error handling in useGitHubData
src/hooks/useGitHubData.ts
Error-handling catch block adds a dedicated condition for "validation failed" API responses, replacing raw GitHub error messages with "Invalid GitHub username or insufficient permissions" for improved user clarity.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • GitMetricsLab/github_tracker#238: Both PRs modify the error-handling catch block in src/hooks/useGitHubData.ts and map GitHub API errors to user-friendly messages.

Suggested labels

level:intermediate, quality:clean

Poem

🐰 A rabbit hops through error logs,
Finding messages in the fog,
Validation failed? Fear not, friend!
Now clearer words your search do mend. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: improving user-friendly error handling for tracker search requests, which matches the core objective of the pull request.
Description check ✅ Passed The description follows the template structure with all key sections completed: Related Issue, Description with specific changes, How Has This Been Tested, Screenshots, and Type of Change selection.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #297: replacing raw API error responses with user-friendly messages, adding handling for invalid usernames/permissions/failed requests, and implementing fallback error messaging.
Out of Scope Changes check ✅ Passed All changes in the PR are directly related to the scope of issue #297; modifications to useGitHubData.ts exclusively address improved error handling for GitHub API requests without introducing unrelated functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

@mehul-m-prajapati mehul-m-prajapati merged commit 8d17610 into GitMetricsLab:main May 17, 2026
6 of 7 checks passed
@github-actions
Copy link
Copy Markdown

🎉🎉 Thank you for your contribution! Your PR #298 has been merged! 🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve user-friendly error handling for invalid GitHub tracker search requests

2 participants