change: Olm exception handling
This commit is contained in:
parent
64a4c0f565
commit
9fac03639e
|
|
@ -392,7 +392,8 @@ class DecryptException implements Exception {
|
|||
DecryptException(this.cause, [this.libolmMessage]);
|
||||
|
||||
@override
|
||||
String toString() => cause;
|
||||
String toString() =>
|
||||
cause + (libolmMessage != null ? ': $libolmMessage' : '');
|
||||
|
||||
static const String notEnabled = 'Encryption is not enabled in your client.';
|
||||
static const String unknownAlgorithm = 'Unknown encryption algorithm.';
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ class OlmManager {
|
|||
try {
|
||||
plaintext = session.session.decrypt(type, body);
|
||||
} catch (e) {
|
||||
// The message was encrypted during this session, but is unable to decrypt
|
||||
throw DecryptException(
|
||||
DecryptException.decryptionFailed, e.toString());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue