improvement: better account data implementation

This commit is contained in:
Timo Kösters 2021-07-30 12:11:06 +02:00
parent 5c776e9ba7
commit 5df6b8cd5f
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
8 changed files with 149 additions and 95 deletions

View file

@ -15,7 +15,7 @@ use ruma::{
RoomAliasId, RoomId, RoomVersionId,
};
use std::{cmp::max, collections::BTreeMap, convert::TryFrom, sync::Arc};
use tracing::info;
use tracing::{info, warn};
#[cfg(feature = "conduit_bin")]
use rocket::{get, post};
@ -233,7 +233,8 @@ pub async fn create_room_route(
// 5. Events listed in initial_state
for event in &body.initial_state {
let pdu_builder = PduBuilder::from(event.deserialize().map_err(|_| {
let pdu_builder = PduBuilder::from(event.deserialize().map_err(|e| {
warn!("Invalid initial state event: {:?}", e);
Error::BadRequest(ErrorKind::InvalidParam, "Invalid initial state event.")
})?);