From b1b2b2ffe2bf49d7a0a09554bf866bd9ea6b47b1 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 5 Nov 2023 09:52:08 +0100 Subject: [PATCH] fix: catch correct exception type for connection problems --- lib/src/client.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/client.dart b/lib/src/client.dart index 8910a6ed..c7515195 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -19,6 +19,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:core'; +import 'dart:io'; import 'dart:math'; import 'dart:typed_data'; @@ -1750,8 +1751,8 @@ class Client extends MatrixApi { Logs().w('The user has been logged out!'); await clear(); } - } on MatrixConnectionException catch (e, s) { - Logs().w('Synchronization connection failed'); + } on IOException catch (e, s) { + Logs().w('Syncloop failed: Client has not connection to the server'); onSyncStatus.add(SyncStatusUpdate(SyncStatus.error, error: SdkError(exception: e, stackTrace: s))); } catch (e, s) {