detect abort error by name here too
This commit is contained in:
parent
3008367307
commit
0691f34650
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ export function abortOnTimeout(createTimeout, timeoutAmount, requestResult, resp
|
||||||
err => {
|
err => {
|
||||||
timeout.abort();
|
timeout.abort();
|
||||||
// map error to TimeoutError
|
// map error to TimeoutError
|
||||||
if (err instanceof AbortError && timedOut) {
|
if (err.name === "AbortError" && timedOut) {
|
||||||
throw new ConnectionError(`Request timed out after ${timeoutAmount}ms`, true);
|
throw new ConnectionError(`Request timed out after ${timeoutAmount}ms`, true);
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
|
|
Reference in a new issue