Skip to content

Commit

Permalink
fix(fetch): remove undefined error cause (#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 Mar 13, 2023
1 parent f04f9fa commit a64eb26
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 a64eb26

Please sign in to comment.