* Throws a `CanceledError` if cancellation has been requested. * * @param {Object} config The config that is to be used for the request * * @returns {void}
(config)
| 15 | * @returns {void} |
| 16 | */ |
| 17 | function 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. |
no test coverage detected