Skip to content

fix: catch exception from fetch call when download Ripgrep binary#21649

Open
XiaoleiJia1005 wants to merge 1 commit intoanomalyco:devfrom
XiaoleiJia1005:XiaoleiJia1005-fix
Open

fix: catch exception from fetch call when download Ripgrep binary#21649
XiaoleiJia1005 wants to merge 1 commit intoanomalyco:devfrom
XiaoleiJia1005:XiaoleiJia1005-fix

Conversation

@XiaoleiJia1005
Copy link
Copy Markdown

@XiaoleiJia1005 XiaoleiJia1005 commented Apr 9, 2026

Issue for this PR

Fixes #21646

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adding a proper .catch() handler around the fetch call responsible for downloading the Ripgrep binary to capture the network exception.
Log the specific target URL that failed to download for debugging purposes.
Throw the existing error RipgrepDownloadFailedError to replace the confusing Unable to connect message.

How did you verify your code works?

bun dev

Screenshots / recordings

Only error message changed, no UI change.
Before

✱ Glob "xxxx.ts" 
Unable to connect. Is the computer able to access the url?

After

✱ Glob "xxxx.ts" 
RipgrepDownloadFailedError

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error handling for Ripgrep binary download in offline environments

1 participant