MCPcopy Create free account
hub / github.com/angular/dev-infra / abortFetch

Function abortFetch

github-actions/bazel/configure-remote/configure-remote.js:13989–14014  ·  view source on GitHub ↗
(p, request, responseObject, error)

Source from the content-addressed store, hash-verified

13987 () => {
13988 locallyAborted = true;
13989 assert(controller != null);
13990 controller.abort(requestObject.signal.reason);
13991 const realResponse = responseObject == null ? void 0 : responseObject.deref();
13992 abortFetch(p, request, realResponse, requestObject.signal.reason);
13993 }
13994 );
13995 const processResponse = (response) => {
13996 if (locallyAborted) {
13997 return;
13998 }
13999 if (response.aborted) {
14000 abortFetch(p, request, responseObject, controller.serializedAbortReason);
14001 return;
14002 }
14003 if (response.type === "error") {
14004 p.reject(new TypeError("fetch failed", { cause: response.error }));
14005 return;
14006 }
14007 responseObject = new WeakRef(fromInnerResponse(response, "immutable"));
14008 p.resolve(responseObject.deref());
14009 p = null;
14010 };
14011 controller = fetching({
14012 request,
14013 processResponseEndOfBody: handleFetchDone,
14014 processResponse,
14015 dispatcher: requestObject[kDispatcher]
14016 // undici
14017 });

Callers 2

fetchFunction · 0.70
processResponseFunction · 0.70

Calls 1

isReadableFunction · 0.70

Tested by

no test coverage detected