feat: Better guard against failed lookups

This commit is contained in:
2022-12-27 01:32:23 +01:00
parent 6c4dd62c5a
commit 5e6b54aab5
5 changed files with 312 additions and 7 deletions

View File

@@ -44,3 +44,11 @@ class InvalidKeyExchangeException extends OmemoException implements Exception {
class MessageAlreadyDecryptedException extends OmemoException implements Exception {
String errMsg() => 'The message has already been decrypted';
}
/// Triggered by the OmemoManager when we could not encrypt a message as we have
/// no key material available. That happens, for example, when we want to create a
/// ratchet session with a JID we had no session with but fetching the device bundle
/// failed.
class NoKeyMaterialAvailableException extends OmemoException implements Exception {
String errMsg() => 'No key material available to create a ratchet session with';
}