2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Include request and config when creating a CanceledError. (#4659)

* changes

* also include request

* revert comment

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Arthur Fiorette
2022-05-03 15:33:38 -03:00
committed by GitHub
parent c07998a621
commit ff1e5cd6c2
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -402,7 +402,7 @@ module.exports = function httpAdapter(config) {
if (req.aborted) return;
req.abort();
reject(!cancel || cancel.type ? new CanceledError() : cancel);
reject(!cancel || cancel.type ? new CanceledError(null, config, req) : cancel);
};
config.cancelToken && config.cancelToken.subscribe(onCanceled);
+1 -1
View File
@@ -193,7 +193,7 @@ module.exports = function xhrAdapter(config) {
if (!request) {
return;
}
reject(!cancel || cancel.type ? new CanceledError() : cancel);
reject(!cancel || cancel.type ? new CanceledError(null, config, req) : cancel);
request.abort();
request = null;
};