diff --git a/lib/src/client.dart b/lib/src/client.dart index e0d40fc..7035a4b 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -66,6 +66,11 @@ enum HTTPType { GET, POST, PUT, DELETE } enum LoginState { logged, loggedOut } +class GenericException implements Exception { + final dynamic content; + GenericException(this.content); +} + /// Represents a Matrix client to communicate with a /// [Matrix](https://matrix.org) homeserver and is the entry point for this /// SDK. @@ -1167,7 +1172,7 @@ class Client { print(s); onOlmError.add( ToDeviceEventDecryptionError( - exception: e, + exception: (e is Exception) ? e : GenericException(e), stackTrace: s, toDeviceEvent: toDeviceEvent, ),