chore(crypto): Log the full error messages when decrypting room events

This commit is contained in:
Damir Jelić
2023-01-23 10:59:14 +01:00
parent f774159e15
commit 00d1437e5a
2 changed files with 5 additions and 9 deletions

View File

@@ -85,7 +85,7 @@ pub enum MegolmError {
/// Decryption failed because we're missing the room key that was to encrypt
/// the event.
#[error("decryption failed because the room key is missing")]
#[error("Can't find the room key to decrypt the event")]
MissingRoomKey,
/// The encrypted megolm message couldn't be decoded.

View File

@@ -1190,17 +1190,13 @@ impl OlmMachine {
match e {
MegolmError::MissingRoomKey
| MegolmError::Decryption(DecryptionError::UnknownMessageIndex(_, _)) => {
// TODO: log the withheld reason if we have one.
debug!(
"Failed to decrypt a room event, the room key is \
missing or has been ratcheted"
);
self.key_request_machine.create_outgoing_key_request(room_id, &event).await?;
}
_ => {
warn!("Failed to decrypt a room event: {e}");
}
_ => {}
}
// TODO: log the withheld reason if we have one.
warn!("Failed to decrypt a room event: {e}");
}
result