Skip to content

Commit

Permalink
feat: more informative error messages (#1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Nov 22, 2022
1 parent 80700c6 commit 93f150f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fetch/response.js
Expand Up @@ -103,7 +103,7 @@ class Response {

// 3. If status is not a redirect status, then throw a RangeError.
if (!redirectStatus.includes(status)) {
throw new RangeError('Invalid status code')
throw new RangeError('Invalid status code ' + status)
}

// 4. Let responseObject be the result of creating a Response object,
Expand Down Expand Up @@ -478,7 +478,7 @@ function initializeResponse (response, init, body) {
if (nullBodyStatus.includes(response.status)) {
throw webidl.errors.exception({
header: 'Response constructor',
message: 'Invalid response status code.'
message: 'Invalid response status code ' + response.status
})
}

Expand Down

0 comments on commit 93f150f

Please sign in to comment.