Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error.cause from undici may be instance of Error #643

Merged

Conversation

nikhilgupta345
Copy link
Contributor

@nikhilgupta345 nikhilgupta345 commented Oct 9, 2023

Resolves #644

Before the change?

I found in my testing that undici may surface the cause property as an Error rather than as a plain string. This meant this if block never got executed and we never bubbled up the actual cause.

After the change?

Correctly handle cause as an Error or as a string, and bubble up the message from the Error, if present.

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

  • Yes
  • No

@nikhilgupta345 nikhilgupta345 changed the title Fix how Undici network errors are surfaced Correctly handle Error causes from undici network errors Oct 9, 2023
@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented label Oct 9, 2023
@wolfy1339 wolfy1339 changed the title Correctly handle Error causes from undici network errors fix: error.cause from undici may be instance of Error Oct 9, 2023
@wolfy1339 wolfy1339 merged commit c67f902 into octokit:main Oct 9, 2023
8 of 9 checks passed
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

🎉 This PR is included in version 8.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG]: Undici network errors still not surfaced properly
2 participants