base: Log deserialization errors for decrypted events.

master
Damir Jelić 2020-12-04 15:07:59 +01:00
parent 1733808221
commit 8a842ec0a5
1 changed files with 6 additions and 3 deletions

View File

@ -49,7 +49,7 @@ use matrix_sdk_crypto::{
Device, EncryptionSettings, IncomingResponse, OlmError, OlmMachine, OutgoingRequest, Sas, Device, EncryptionSettings, IncomingResponse, OlmError, OlmMachine, OutgoingRequest, Sas,
ToDeviceRequest, UserDevices, ToDeviceRequest, UserDevices,
}; };
use tracing::info; use tracing::{info, warn};
use zeroize::Zeroizing; use zeroize::Zeroizing;
use crate::{ use crate::{
@ -481,8 +481,11 @@ impl BaseClient {
if let Ok(decrypted) = if let Ok(decrypted) =
olm.decrypt_room_event(encrypted, room_id).await olm.decrypt_room_event(encrypted, room_id).await
{ {
if let Ok(decrypted) = decrypted.deserialize() { match decrypted.deserialize() {
e = decrypted; Ok(decrypted) => e = decrypted,
Err(e) => {
warn!("Error deserializing a decrypted event {:?} ", e)
}
} }
} }
} }