1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Consolidate error handling retry logic

This commit is contained in:
Kegan Dougal
2022-10-13 10:52:40 +01:00
parent 41a973a3c6
commit bb3d51652d

View File

@@ -846,17 +846,15 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
currentPos = undefined;
await sleep(50); // in case the 400 was for something else; don't tightloop
continue;
}
await sleep(5000);
} // else fallthrough to generic error handling
} else if (this.needsResend || err === "aborted") {
// don't sleep as we caused this error by abort()ing the request.
// we check for 'aborted' because that's the error Jest returns and without it
// we get warnings about not exiting fast enough.
continue;
} else {
logger.error(err);
await sleep(5000);
}
logger.error(err);
await sleep(5000);
}
if (!resp) {
continue;