MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / abortFetch

Function abortFetch

out/cli.cjs:59979–60004  ·  view source on GitHub ↗
(p4, request3, responseObject, error)

Source from the content-addressed store, hash-verified

59977 cacheState
59978 );
59979 }
59980 function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) {
59981 if (nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 2) {
59982 performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState);
59983 }
59984 }
59985 function abortFetch(p4, request3, responseObject, error) {
59986 if (!error) {
59987 error = new DOMException3("The operation was aborted.", "AbortError");
59988 }
59989 p4.reject(error);
59990 if (request3.body != null && isReadable(request3.body?.stream)) {
59991 request3.body.stream.cancel(error).catch((err) => {
59992 if (err.code === "ERR_INVALID_STATE") {
59993 return;
59994 }
59995 throw err;
59996 });
59997 }
59998 if (responseObject == null) {
59999 return;
60000 }
60001 const response = responseObject[kState];
60002 if (response.body != null && isReadable(response.body?.stream)) {
60003 response.body.stream.cancel(error).catch((err) => {
60004 if (err.code === "ERR_INVALID_STATE") {
60005 return;
60006 }
60007 throw err;

Callers 2

fetch4Function · 0.85
processResponseFunction · 0.85

Calls 3

isReadableFunction · 0.85
catchMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…