diff --git a/src/api/client_server/room.rs b/src/api/client_server/room.rs index cef9c9b4..144ed131 100644 --- a/src/api/client_server/room.rs +++ b/src/api/client_server/room.rs @@ -149,7 +149,10 @@ pub async fn create_room_route( Some(content) => { let mut content = content .deserialize_as::() - .expect("Invalid creation content"); + .map_err(|e| { + error!("Failed to deserialise content as canonical JSON: {}", e); + Error::bad_database("Failed to deserialise content as canonical JSON.") + })?; match room_version { RoomVersionId::V1 | RoomVersionId::V2