MCPcopy
hub / github.com/axios/axios / throwIfCancellationRequested

Function throwIfCancellationRequested

lib/core/dispatchRequest.js:17–25  ·  view source on GitHub ↗

* Throws a `CanceledError` if cancellation has been requested. * * @param {Object} config The config that is to be used for the request * * @returns {void}

(config)

Source from the content-addressed store, hash-verified

15 * @returns {void}
16 */
17function throwIfCancellationRequested(config) {
18 if (config.cancelToken) {
19 config.cancelToken.throwIfRequested();
20 }
21
22 if (config.signal && config.signal.aborted) {
23 throw new CanceledError(null, config);
24 }
25}
26
27/**
28 * Dispatch a request to the server using the configured adapter.

Callers 1

dispatchRequestFunction · 0.85

Calls 1

throwIfRequestedMethod · 0.65

Tested by

no test coverage detected