From d74f9b4b848813404a26c2f5b536c6632c3c458c Mon Sep 17 00:00:00 2001 From: Giles Copp Date: Wed, 18 Dec 2024 10:18:18 -0500 Subject: [PATCH] For request failures and timeouts, include the URLs in the errors --- fetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch.js b/fetch.js index f39a983a..3105a479 100644 --- a/fetch.js +++ b/fetch.js @@ -558,13 +558,13 @@ export function fetch(input, init) { xhr.onerror = function() { setTimeout(function() { - reject(new TypeError('Network request failed')) + reject(new TypeError('Network request ('+request.method+' '+request.url+') failed')) }, 0) } xhr.ontimeout = function() { setTimeout(function() { - reject(new TypeError('Network request timed out')) + reject(new TypeError('Network request ('+request.method+' '+request.url+') timed out')) }, 0) }