mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +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 => {
|
||||
timeout.abort();
|
||||
// map error to TimeoutError
|
||||
if (err instanceof AbortError && timedOut) {
|
||||
if (err.name === "AbortError" && timedOut) {
|
||||
throw new ConnectionError(`Request timed out after ${timeoutAmount}ms`, true);
|
||||
} else {
|
||||
throw err;
|
||||
|
Loading…
Reference in New Issue
Block a user