Expose MissingRoomKey decryption error

This commit is contained in:
Andy Uhnak
2023-01-24 15:02:59 +00:00
committed by Damir Jelić
parent 18ec101719
commit 2db1bc75c1
2 changed files with 14 additions and 2 deletions

View File

@@ -59,8 +59,19 @@ pub enum DecryptionError {
Serialization(#[from] serde_json::Error),
#[error(transparent)]
Identifier(#[from] IdParseError),
#[error(transparent)]
Megolm(#[from] MegolmError),
#[error("Megolm decryption error: {error_message}")]
Megolm { error_message: String },
#[error("Can't find the room key to decrypt the event")]
MissingRoomKey,
#[error(transparent)]
Store(#[from] InnerStoreError),
}
impl From<MegolmError> for DecryptionError {
fn from(value: MegolmError) -> Self {
match value {
MegolmError::MissingRoomKey => Self::MissingRoomKey,
_ => Self::Megolm { error_message: value.to_string() },
}
}
}

View File

@@ -59,6 +59,7 @@ enum DecryptionError {
"Identifier",
"Serialization",
"Megolm",
"MissingRoomKey",
"Store",
};