Skip to content

Commit

Permalink
fix(fetch): remove undefined error cause (nodejs#2006)
Browse files Browse the repository at this point in the history
We have checked on the line before that `isError` is falsy, so the cause is always set to `undefined`, which is not very useful.
  • Loading branch information
aduh95 authored and crysmags committed Feb 27, 2024
1 parent 5b99528 commit 39fa7f5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/fetch/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ function makeNetworkError (reason) {
status: 0,
error: isError
? reason
: new Error(reason ? String(reason) : reason, {
cause: isError ? reason : undefined
}),
: new Error(reason ? String(reason) : reason),
aborted: reason && reason.name === 'AbortError'
})
}
Expand Down

0 comments on commit 39fa7f5

Please sign in to comment.