mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-19 14:19:06 -04:00
Expose MissingRoomKey decryption error
This commit is contained in:
@@ -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() },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ enum DecryptionError {
|
||||
"Identifier",
|
||||
"Serialization",
|
||||
"Megolm",
|
||||
"MissingRoomKey",
|
||||
"Store",
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user