mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
detect abort error by name here too
This commit is contained in:
parent
3008367307
commit
0691f34650
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user