log error for invalid room member events in db
Signed-off-by: strawberry <strawberry@pupbrain.dev>
This commit is contained in:
parent
d13e3827ce
commit
b4e2f7ca37
1 changed files with 4 additions and 1 deletions
|
@ -1468,7 +1468,10 @@ pub async fn leave_room(user_id: &UserId, room_id: &RoomId, reason: Option<Strin
|
|||
};
|
||||
|
||||
let mut event: RoomMemberEventContent = serde_json::from_str(member_event.content.get())
|
||||
.map_err(|_| Error::bad_database("Invalid member event in database."))?;
|
||||
.map_err(|e| {
|
||||
error!("Invalid room member event in database: {}", e);
|
||||
Error::bad_database("Invalid member event in database.")
|
||||
})?;
|
||||
|
||||
event.membership = MembershipState::Leave;
|
||||
event.reason = reason;
|
||||
|
|
Loading…
Add table
Reference in a new issue