MCPcopy Index your code
hub / github.com/nodejs/node / abortFetch

Function abortFetch

deps/undici/undici.js:13589–13608  ·  view source on GitHub ↗
(p, request, responseObject, error, controller)

Source from the content-addressed store, hash-verified

13587 __name(finalizeAndReportTiming, "finalizeAndReportTiming");
13588 var markResourceTiming = performance.markResourceTiming;
13589 function abortFetch(p, request, responseObject, error, controller) {
13590 if (p) {
13591 p.reject(error);
13592 }
13593 if (request.body?.stream != null && isReadable(request.body.stream)) {
13594 request.body.stream.cancel(error).catch((err) => {
13595 if (err.code === "ERR_INVALID_STATE") {
13596 return;
13597 }
13598 throw err;
13599 });
13600 }
13601 if (responseObject == null) {
13602 return;
13603 }
13604 const response = getResponseState(responseObject);
13605 if (response.body?.stream != null && isReadable(response.body.stream)) {
13606 controller.error(error);
13607 }
13608 }
13609 __name(abortFetch, "abortFetch");
13610 function fetching({
13611 request,

Callers 1

fetch2Function · 0.70

Calls 4

isReadableFunction · 0.85
rejectMethod · 0.80
cancelMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected