diff --git a/src/rooms.jl b/src/rooms.jl index 1337c83..0556c77 100644 --- a/src/rooms.jl +++ b/src/rooms.jl @@ -60,7 +60,17 @@ end function history(u::MatrixUser, room_id::String; limit = 15) res = roomhistory(u, room_id, limit = limit) - map(x -> println(MatrixMsg(x["sender"], x["origin_server_ts"], - x["content"]["msgtype"], x["content"]["body"], - )), res["chunk"]) + map(x -> try + println(MatrixMsg(x["sender"], x["origin_server_ts"], + x["content"]["msgtype"], x["content"]["body"], + )) + catch e + if isa(e, KeyError) + @warn "Improve me! Key not found:" + @show x + else + throw(e) + end + end + , res["chunk"]) end