MCPcopy Create free account
hub / github.com/nodejs/node / makeNetworkError

Function makeNetworkError

deps/undici/src/lib/web/fetch/response.js:385–395  ·  view source on GitHub ↗
(reason)

Source from the content-addressed store, hash-verified

383}
384
385function makeNetworkError (reason) {
386 const isError = isErrorLike(reason)
387 return makeResponse({
388 type: 'error',
389 status: 0,
390 error: isError
391 ? reason
392 : new Error(reason ? String(reason) : reason),
393 aborted: reason && reason.name === 'AbortError'
394 })
395}
396
397// @see https://fetch.spec.whatwg.org/#concept-network-error
398function isNetworkError (response) {

Callers 9

mainFetchFunction · 0.70
processBodyErrorFunction · 0.70
schemeFetchFunction · 0.70
httpFetchFunction · 0.70
httpRedirectFetchFunction · 0.70
httpNetworkOrCacheFetchFunction · 0.70
httpNetworkFetchFunction · 0.70
errorMethod · 0.70

Calls 3

StringClass · 0.85
isErrorLikeFunction · 0.70
makeResponseFunction · 0.70

Tested by

no test coverage detected