You've already forked matrix-js-sdk
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:
@@ -846,18 +846,16 @@ export class SlidingSync extends TypedEventEmitter<SlidingSyncEvent, SlidingSync
|
|||||||
currentPos = undefined;
|
currentPos = undefined;
|
||||||
await sleep(50); // in case the 400 was for something else; don't tightloop
|
await sleep(50); // in case the 400 was for something else; don't tightloop
|
||||||
continue;
|
continue;
|
||||||
}
|
} // else fallthrough to generic error handling
|
||||||
await sleep(5000);
|
|
||||||
} else if (this.needsResend || err === "aborted") {
|
} else if (this.needsResend || err === "aborted") {
|
||||||
// don't sleep as we caused this error by abort()ing the request.
|
// 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 check for 'aborted' because that's the error Jest returns and without it
|
||||||
// we get warnings about not exiting fast enough.
|
// we get warnings about not exiting fast enough.
|
||||||
continue;
|
continue;
|
||||||
} else {
|
}
|
||||||
logger.error(err);
|
logger.error(err);
|
||||||
await sleep(5000);
|
await sleep(5000);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!resp) {
|
if (!resp) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user