Merge branch 'krille/refactor-encryption-errors' into 'main'
refactor: Encryption errors See merge request famedly/famedlysdk!565
This commit is contained in:
commit
b0e90f000d
|
|
@ -46,13 +46,6 @@ class Encryption {
|
|||
String get fingerprintKey => olmManager.fingerprintKey;
|
||||
String get identityKey => olmManager.identityKey;
|
||||
|
||||
/// ToDeviceEventDecryptionError erros are coming here.
|
||||
final StreamController<ToDeviceEventDecryptionError>
|
||||
onToDeviceEventDecryptionError = StreamController.broadcast();
|
||||
|
||||
/// All other erros are coming here.
|
||||
final StreamController<SdkError> onError = StreamController.broadcast();
|
||||
|
||||
KeyManager keyManager;
|
||||
OlmManager olmManager;
|
||||
KeyVerificationManager keyVerificationManager;
|
||||
|
|
@ -145,11 +138,10 @@ class Encryption {
|
|||
Logs.error(
|
||||
'[LibOlm] Could not decrypt to device event from ${event.sender} with content: ${event.content}\n${e.toString()}',
|
||||
s);
|
||||
onToDeviceEventDecryptionError.add(
|
||||
ToDeviceEventDecryptionError(
|
||||
client.onEncryptionError.add(
|
||||
SdkError(
|
||||
exception: e is Exception ? e : Exception(e),
|
||||
stackTrace: s,
|
||||
toDeviceEvent: event,
|
||||
),
|
||||
);
|
||||
return event;
|
||||
|
|
|
|||
|
|
@ -557,7 +557,9 @@ class Bootstrap {
|
|||
'[Bootstrapping] Error setting up online key backup: ' + e.toString(),
|
||||
s);
|
||||
state = BootstrapState.error;
|
||||
encryption.onError.add(SdkError(exception: e, stackTrace: s));
|
||||
encryption.client.onEncryptionError.add(
|
||||
SdkError(exception: e, stackTrace: s),
|
||||
);
|
||||
return;
|
||||
}
|
||||
state = BootstrapState.done;
|
||||
|
|
|
|||
|
|
@ -573,9 +573,8 @@ class Client extends MatrixApi {
|
|||
/// Synchronization erros are coming here.
|
||||
final StreamController<SdkError> onSyncError = StreamController.broadcast();
|
||||
|
||||
/// Synchronization erros are coming here.
|
||||
@Deprecated('Please use encryption.onToDeviceEventDecryptionError instead')
|
||||
final StreamController<ToDeviceEventDecryptionError> onOlmError =
|
||||
/// Encryption erros are coming here.
|
||||
final StreamController<SdkError> onEncryptionError =
|
||||
StreamController.broadcast();
|
||||
|
||||
/// This is called once, when the first sync has received.
|
||||
|
|
|
|||
Loading…
Reference in New Issue