Skip to content

Commit

Permalink
For request failures and timeouts, include the URLs in the errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Giles Copp committed Dec 18, 2024
1 parent ba5cf1e commit d74f9b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d74f9b4

Please sign in to comment.