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

feat: more informative error messages #1781

Merged
merged 1 commit into from Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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