history: warn on error
parent
63a896fcc3
commit
e2f0ad09da
16
src/rooms.jl
16
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
|
||||
|
|
Loading…
Reference in New Issue