Merge pull request #1633 from famedly/krille/do-not-hide-matrix-exceptions-in-sync

fix: Do not hide matrix exceptions in sync
This commit is contained in:
Krille-chan 2023-12-06 11:04:52 +01:00 committed by GitHub
commit 562363c263
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1684,7 +1684,7 @@ class Client extends MatrixApi {
Logs().d('Running sync while init isn\'t done yet, dropping request');
return;
}
SyncConnectionException? syncError;
Object? syncError;
await _checkSyncFilter();
timeout ??= const Duration(seconds: 30);
final syncRequest = sync(
@ -1693,7 +1693,11 @@ class Client extends MatrixApi {
timeout: timeout.inMilliseconds,
setPresence: syncPresence,
).then((v) => Future<SyncUpdate?>.value(v)).catchError((e) {
syncError = SyncConnectionException(e);
if (e is MatrixException) {
syncError = e;
} else {
syncError = SyncConnectionException(e);
}
return null;
});
_currentSyncId = syncRequest.hashCode;