From 93f150f5bbf0ce66d50d9b419277b2b13141b8b3 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 22 Nov 2022 12:26:10 -0800 Subject: [PATCH] feat: more informative error messages (#1781) --- lib/fetch/response.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fetch/response.js b/lib/fetch/response.js index 7828c2d1b3e..fc6746bfa8d 100644 --- a/lib/fetch/response.js +++ b/lib/fetch/response.js @@ -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, @@ -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 }) }