octokit / request.js

Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node
MIT License
228 stars 60 forks source link

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

Closed nikhilgupta345 closed 12 months ago

nikhilgupta345 commented 12 months ago

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

Does this introduce a breaking change?


github-actions[bot] commented 12 months ago

:tada: This PR is included in version 8.1.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: