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)
|
function history(u::MatrixUser, room_id::String; limit = 15)
|
||||||
res = roomhistory(u, room_id, limit = limit)
|
res = roomhistory(u, room_id, limit = limit)
|
||||||
map(x -> println(MatrixMsg(x["sender"], x["origin_server_ts"],
|
map(x -> try
|
||||||
x["content"]["msgtype"], x["content"]["body"],
|
println(MatrixMsg(x["sender"], x["origin_server_ts"],
|
||||||
)), res["chunk"])
|
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue