fix new error reported from rust side

This commit is contained in:
valere 2023-02-02 16:15:53 +01:00
parent 1b4885ccab
commit ebed3195bf

View file

@ -468,10 +468,13 @@ internal class OlmMachine @Inject constructor(
) )
} catch (throwable: Throwable) { } catch (throwable: Throwable) {
val reThrow = when (throwable) { val reThrow = when (throwable) {
is DecryptionException.Megolm -> { is DecryptionException.MissingRoomKey -> {
// TODO more bindings for missing room key
MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID, throwable.message.orEmpty()) MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID, throwable.message.orEmpty())
} }
is DecryptionException.Megolm -> {
// TODO check if it's the correct binding?
MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX, throwable.message.orEmpty())
}
is DecryptionException.Identifier -> { is DecryptionException.Identifier -> {
MXCryptoError.Base(MXCryptoError.ErrorType.BAD_EVENT_FORMAT, MXCryptoError.BAD_EVENT_FORMAT_TEXT_REASON) MXCryptoError.Base(MXCryptoError.ErrorType.BAD_EVENT_FORMAT, MXCryptoError.BAD_EVENT_FORMAT_TEXT_REASON)
} }