(fetchParams, err = null)
| 478 | |
| 479 | // https://fetch.spec.whatwg.org/#appropriate-network-error |
| 480 | function makeAppropriateNetworkError (fetchParams, err = null) { |
| 481 | // 1. Assert: fetchParams is canceled. |
| 482 | assert(isCancelled(fetchParams)) |
| 483 | |
| 484 | // 2. Return an aborted network error if fetchParams is aborted; |
| 485 | // otherwise return a network error. |
| 486 | return isAborted(fetchParams) |
| 487 | ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) |
| 488 | : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) |
| 489 | } |
| 490 | |
| 491 | // https://whatpr.org/fetch/1392.html#initialize-a-response |
| 492 | function initializeResponse (response, init, body) { |
no test coverage detected